| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_PROFILES_PROFILES_STATE_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILES_STATE_H_ |
| 6 #define CHROME_BROWSER_PROFILES_PROFILES_STATE_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILES_STATE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "chrome/browser/profiles/avatar_menu.h" | 10 #include "chrome/browser/profiles/avatar_menu.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 // Returns the string to use in the avatar button for the specified profile. | 38 // Returns the string to use in the avatar button for the specified profile. |
| 39 // This is essentially the name returned by GetAvatarNameForProfile, but it | 39 // This is essentially the name returned by GetAvatarNameForProfile, but it |
| 40 // may be elided and contain an indicator for supervised users. | 40 // may be elided and contain an indicator for supervised users. |
| 41 base::string16 GetAvatarButtonTextForProfile(Profile* profile); | 41 base::string16 GetAvatarButtonTextForProfile(Profile* profile); |
| 42 | 42 |
| 43 // Returns the string to use in the fast user switcher menu for the specified | 43 // Returns the string to use in the fast user switcher menu for the specified |
| 44 // menu item. Adds a supervision indicator to the profile name if appropriate. | 44 // menu item. Adds a supervision indicator to the profile name if appropriate. |
| 45 base::string16 GetProfileSwitcherTextForItem(const AvatarMenu::Item& item); | 45 base::string16 GetProfileSwitcherTextForItem(const AvatarMenu::Item& item); |
| 46 | 46 |
| 47 // Update the name of |profile| to |new_profile_name|. This updates the | 47 // Update the name of |profile| to |new_profile_name|. This updates the profile |
| 48 // profile preferences, which triggers an update in the ProfileInfoCache. | 48 // preferences, which triggers an update in the ProfileAttributesStorage. This |
| 49 // This method should be called when the user is explicitely changing | 49 // method should be called when the user is explicitely changing the profile |
| 50 // the profile name, as it will always set |prefs::kProfileUsingDefaultName| | 50 // name, as it will always set |prefs::kProfileUsingDefaultName| to false. |
| 51 // to false. | |
| 52 void UpdateProfileName(Profile* profile, | 51 void UpdateProfileName(Profile* profile, |
| 53 const base::string16& new_profile_name); | 52 const base::string16& new_profile_name); |
| 54 | 53 |
| 55 // Returns the list of secondary accounts for a specific |profile|, which is | 54 // Returns the list of secondary accounts for a specific |profile|, which is |
| 56 // all the email addresses associated with the profile that are not equal to | 55 // all the email addresses associated with the profile that are not equal to |
| 57 // the |primary_account|. | 56 // the |primary_account|. |
| 58 std::vector<std::string> GetSecondaryAccountsForProfile( | 57 std::vector<std::string> GetSecondaryAccountsForProfile( |
| 59 Profile* profile, | 58 Profile* profile, |
| 60 const std::string& primary_account); | 59 const std::string& primary_account); |
| 61 | 60 |
| 62 // Returns whether the |browser|'s profile is a non-incognito or guest profile. | 61 // Returns whether the |browser|'s profile is a non-incognito or guest profile. |
| 63 // The distinction is needed because guest profiles are implemented as | 62 // The distinction is needed because guest profiles are implemented as |
| 64 // incognito profiles. | 63 // incognito profiles. |
| 65 bool IsRegularOrGuestSession(Browser* browser); | 64 bool IsRegularOrGuestSession(Browser* browser); |
| 66 | 65 |
| 67 // Returns true if sign in is required to browse as this profile. Call with | 66 // Returns true if sign in is required to browse as this profile. Call with |
| 68 // profile->GetPath() if you have a profile pointer. | 67 // profile->GetPath() if you have a profile pointer. |
| 69 // TODO(mlerman): Refactor appropriate calls to | 68 // TODO(mlerman): Refactor appropriate calls to |
| 70 // ProfileInfoCache::ProfileIsSigninRequiredAtIndex to call here instead. | 69 // ProfileAttributesStorage::IsSigninRequired to call here instead. |
| 71 bool IsProfileLocked(const base::FilePath& path); | 70 bool IsProfileLocked(const base::FilePath& profile_path); |
| 72 | 71 |
| 73 // If the lock-enabled information for this profile is not up to date, starts | 72 // If the lock-enabled information for this profile is not up to date, starts |
| 74 // an update for the Gaia profile info. | 73 // an update for the Gaia profile info. |
| 75 void UpdateIsProfileLockEnabledIfNeeded(Profile* profile); | 74 void UpdateIsProfileLockEnabledIfNeeded(Profile* profile); |
| 76 | 75 |
| 77 // If the --google-profile-info flag is turned on, starts an update for a new | 76 // If the --google-profile-info flag is turned on, starts an update for a new |
| 78 // version of the Gaia profile picture and other profile info. | 77 // version of the Gaia profile picture and other profile info. |
| 79 void UpdateGaiaProfileInfoIfNeeded(Profile* profile); | 78 void UpdateGaiaProfileInfoIfNeeded(Profile* profile); |
| 80 | 79 |
| 81 // Returns the sign-in error controller for the given profile. Some profiles, | 80 // Returns the sign-in error controller for the given profile. Some profiles, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 100 // dismissed by a user, false otherwise. | 99 // dismissed by a user, false otherwise. |
| 101 bool GetFastUserSwitchingTutorialDismissedState(); | 100 bool GetFastUserSwitchingTutorialDismissedState(); |
| 102 | 101 |
| 103 // Sets the last used profile pref to |profile_dir|, unless |profile_dir| is the | 102 // Sets the last used profile pref to |profile_dir|, unless |profile_dir| is the |
| 104 // System Profile directory, which is an invalid last used profile. | 103 // System Profile directory, which is an invalid last used profile. |
| 105 void SetLastUsedProfile(const std::string& profile_dir); | 104 void SetLastUsedProfile(const std::string& profile_dir); |
| 106 | 105 |
| 107 } // namespace profiles | 106 } // namespace profiles |
| 108 | 107 |
| 109 #endif // CHROME_BROWSER_PROFILES_PROFILES_STATE_H_ | 108 #endif // CHROME_BROWSER_PROFILES_PROFILES_STATE_H_ |
| OLD | NEW |