| 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 profile | 47 // Update the name of |profile| to |new_profile_name|. This updates the |
| 48 // preferences, which triggers an update in the ProfileAttributesStorage. This | 48 // profile preferences, which triggers an update in the ProfileInfoCache. |
| 49 // method should be called when the user is explicitely changing the profile | 49 // This method should be called when the user is explicitely changing |
| 50 // name, as it will always set |prefs::kProfileUsingDefaultName| to false. | 50 // the profile name, as it will always set |prefs::kProfileUsingDefaultName| |
| 51 // to false. |
| 51 void UpdateProfileName(Profile* profile, | 52 void UpdateProfileName(Profile* profile, |
| 52 const base::string16& new_profile_name); | 53 const base::string16& new_profile_name); |
| 53 | 54 |
| 54 // Returns the list of secondary accounts for a specific |profile|, which is | 55 // Returns the list of secondary accounts for a specific |profile|, which is |
| 55 // all the email addresses associated with the profile that are not equal to | 56 // all the email addresses associated with the profile that are not equal to |
| 56 // the |primary_account|. | 57 // the |primary_account|. |
| 57 std::vector<std::string> GetSecondaryAccountsForProfile( | 58 std::vector<std::string> GetSecondaryAccountsForProfile( |
| 58 Profile* profile, | 59 Profile* profile, |
| 59 const std::string& primary_account); | 60 const std::string& primary_account); |
| 60 | 61 |
| 61 // Returns whether the |browser|'s profile is a non-incognito or guest profile. | 62 // Returns whether the |browser|'s profile is a non-incognito or guest profile. |
| 62 // The distinction is needed because guest profiles are implemented as | 63 // The distinction is needed because guest profiles are implemented as |
| 63 // incognito profiles. | 64 // incognito profiles. |
| 64 bool IsRegularOrGuestSession(Browser* browser); | 65 bool IsRegularOrGuestSession(Browser* browser); |
| 65 | 66 |
| 66 // Returns true if sign in is required to browse as this profile. Call with | 67 // Returns true if sign in is required to browse as this profile. Call with |
| 67 // profile->GetPath() if you have a profile pointer. | 68 // profile->GetPath() if you have a profile pointer. |
| 68 // TODO(mlerman): Refactor appropriate calls to | 69 // TODO(mlerman): Refactor appropriate calls to |
| 69 // ProfileAttributesStorage::IsSigninRequired to call here instead. | 70 // ProfileInfoCache::ProfileIsSigninRequiredAtIndex to call here instead. |
| 70 bool IsProfileLocked(const base::FilePath& profile_path); | 71 bool IsProfileLocked(const base::FilePath& path); |
| 71 | 72 |
| 72 // If the lock-enabled information for this profile is not up to date, starts | 73 // If the lock-enabled information for this profile is not up to date, starts |
| 73 // an update for the Gaia profile info. | 74 // an update for the Gaia profile info. |
| 74 void UpdateIsProfileLockEnabledIfNeeded(Profile* profile); | 75 void UpdateIsProfileLockEnabledIfNeeded(Profile* profile); |
| 75 | 76 |
| 76 // If the --google-profile-info flag is turned on, starts an update for a new | 77 // If the --google-profile-info flag is turned on, starts an update for a new |
| 77 // version of the Gaia profile picture and other profile info. | 78 // version of the Gaia profile picture and other profile info. |
| 78 void UpdateGaiaProfileInfoIfNeeded(Profile* profile); | 79 void UpdateGaiaProfileInfoIfNeeded(Profile* profile); |
| 79 | 80 |
| 80 // Returns the sign-in error controller for the given profile. Some profiles, | 81 // Returns the sign-in error controller for the given profile. Some profiles, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 99 // dismissed by a user, false otherwise. | 100 // dismissed by a user, false otherwise. |
| 100 bool GetFastUserSwitchingTutorialDismissedState(); | 101 bool GetFastUserSwitchingTutorialDismissedState(); |
| 101 | 102 |
| 102 // Sets the last used profile pref to |profile_dir|, unless |profile_dir| is the | 103 // Sets the last used profile pref to |profile_dir|, unless |profile_dir| is the |
| 103 // System Profile directory, which is an invalid last used profile. | 104 // System Profile directory, which is an invalid last used profile. |
| 104 void SetLastUsedProfile(const std::string& profile_dir); | 105 void SetLastUsedProfile(const std::string& profile_dir); |
| 105 | 106 |
| 106 } // namespace profiles | 107 } // namespace profiles |
| 107 | 108 |
| 108 #endif // CHROME_BROWSER_PROFILES_PROFILES_STATE_H_ | 109 #endif // CHROME_BROWSER_PROFILES_PROFILES_STATE_H_ |
| OLD | NEW |