Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / browser / profiles / profile_info_interface.h
bloba261e34b375b1449a30f24f3ed46ec6e51f2feab
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_INFO_INTERFACE_H_
6 #define CHROME_BROWSER_PROFILES_PROFILE_INFO_INTERFACE_H_
8 #include "base/files/file_path.h"
9 #include "base/strings/string16.h"
11 namespace base {
12 class Time;
15 namespace gfx {
16 class Image;
19 // This abstract interface is used to query the profiles backend for information
20 // about the different profiles. Its sole concrete implementation is the
21 // ProfileInfoCache. This interface exists largely to assist in testing.
22 // The ProfileInfoInterface is being deprecated. Prefer using the
23 // ProfileAttributesStorage and avoid using the Get*AtIndex family of functions.
24 class ProfileInfoInterface {
25 public:
26 virtual size_t GetNumberOfProfiles() const = 0;
28 virtual size_t GetIndexOfProfileWithPath(
29 const base::FilePath& profile_path) const = 0;
31 virtual base::Time GetProfileActiveTimeAtIndex(size_t index) const = 0;
33 virtual base::string16 GetNameOfProfileAtIndex(size_t index) const = 0;
35 virtual base::string16 GetShortcutNameOfProfileAtIndex(
36 size_t index) const = 0;
38 virtual base::FilePath GetPathOfProfileAtIndex(size_t index) const = 0;
40 virtual base::string16 GetUserNameOfProfileAtIndex(size_t index) const = 0;
42 virtual const gfx::Image& GetAvatarIconOfProfileAtIndex(size_t index) = 0;
44 virtual std::string GetLocalAuthCredentialsOfProfileAtIndex(
45 size_t index) const = 0;
46 virtual std::string GetPasswordChangeDetectionTokenAtIndex(
47 size_t index) const = 0;
49 // Returns true if the profile at the given index is currently running any
50 // background apps.
51 virtual bool GetBackgroundStatusOfProfileAtIndex(
52 size_t index) const = 0;
54 virtual base::string16 GetGAIANameOfProfileAtIndex(size_t index) const = 0;
56 virtual base::string16 GetGAIAGivenNameOfProfileAtIndex(
57 size_t index) const = 0;
59 virtual std::string GetGAIAIdOfProfileAtIndex(size_t index) const = 0;
61 virtual const gfx::Image* GetGAIAPictureOfProfileAtIndex(
62 size_t index) const = 0;
64 // Checks if the GAIA picture should be used as the profile's avatar icon.
65 virtual bool IsUsingGAIAPictureOfProfileAtIndex(size_t index) const = 0;
67 // Returns whether the profile is supervised (either a legacy supervised
68 // user or a child account; see SupervisedUserService).
69 virtual bool ProfileIsSupervisedAtIndex(size_t index) const = 0;
70 // Returns whether the profile is associated with a child account.
71 virtual bool ProfileIsChildAtIndex(size_t index) const = 0;
72 // Returns whether the profile is a legacy supervised user profile.
73 virtual bool ProfileIsLegacySupervisedAtIndex(size_t index) const = 0;
75 // Returns true if the profile should be omitted from the desktop profile
76 // list (see ProfileListDesktop), so it won't appear in the avatar menu.
77 virtual bool IsOmittedProfileAtIndex(size_t index) const = 0;
79 virtual std::string GetSupervisedUserIdOfProfileAtIndex(
80 size_t index) const = 0;
82 // This profile is associated with an account but has been signed-out.
83 virtual bool ProfileIsSigninRequiredAtIndex(size_t index) const = 0;
85 // Profile is known to be ephemeral and should be deleted when closed.
86 virtual bool ProfileIsEphemeralAtIndex(size_t index) const = 0;
88 // Returns true if the profile is using the name it was assigned by default
89 // at creation (either the old-style "Lemonade" name, or the new "Profile %d"
90 // style name).
91 virtual bool ProfileIsUsingDefaultNameAtIndex(size_t index) const = 0;
93 // Returns true if the user has never manually selected a profile avatar.
94 virtual bool ProfileIsUsingDefaultAvatarAtIndex(size_t index) const = 0;
96 // Returns true if the given profile is connected to an account.
97 virtual bool ProfileIsAuthenticatedAtIndex(size_t index) const = 0;
99 protected:
100 virtual ~ProfileInfoInterface() {}
103 #endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_INTERFACE_H_