| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PROFILE_INFO_CACHE_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ |
| 6 #define CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 virtual const gfx::Image* GetGAIAPictureOfProfileAtIndex( | 84 virtual const gfx::Image* GetGAIAPictureOfProfileAtIndex( |
| 85 size_t index) const OVERRIDE; | 85 size_t index) const OVERRIDE; |
| 86 virtual bool IsUsingGAIAPictureOfProfileAtIndex( | 86 virtual bool IsUsingGAIAPictureOfProfileAtIndex( |
| 87 size_t index) const OVERRIDE; | 87 size_t index) const OVERRIDE; |
| 88 virtual bool ProfileIsManagedAtIndex(size_t index) const OVERRIDE; | 88 virtual bool ProfileIsManagedAtIndex(size_t index) const OVERRIDE; |
| 89 virtual bool IsOmittedProfileAtIndex(size_t index) const OVERRIDE; | 89 virtual bool IsOmittedProfileAtIndex(size_t index) const OVERRIDE; |
| 90 virtual bool ProfileIsSigninRequiredAtIndex(size_t index) const OVERRIDE; | 90 virtual bool ProfileIsSigninRequiredAtIndex(size_t index) const OVERRIDE; |
| 91 virtual std::string GetManagedUserIdOfProfileAtIndex(size_t index) const | 91 virtual std::string GetManagedUserIdOfProfileAtIndex(size_t index) const |
| 92 OVERRIDE; | 92 OVERRIDE; |
| 93 virtual bool ProfileIsEphemeralAtIndex(size_t index) const OVERRIDE; | 93 virtual bool ProfileIsEphemeralAtIndex(size_t index) const OVERRIDE; |
| 94 virtual bool ProfileIsUsingDefaultNameAtIndex(size_t index) const OVERRIDE; |
| 94 | 95 |
| 95 size_t GetAvatarIconIndexOfProfileAtIndex(size_t index) const; | 96 size_t GetAvatarIconIndexOfProfileAtIndex(size_t index) const; |
| 96 | 97 |
| 97 void SetProfileActiveTimeAtIndex(size_t index); | 98 void SetProfileActiveTimeAtIndex(size_t index); |
| 98 void SetNameOfProfileAtIndex(size_t index, const base::string16& name); | 99 void SetNameOfProfileAtIndex(size_t index, const base::string16& name); |
| 99 void SetShortcutNameOfProfileAtIndex(size_t index, | 100 void SetShortcutNameOfProfileAtIndex(size_t index, |
| 100 const base::string16& name); | 101 const base::string16& name); |
| 101 void SetUserNameOfProfileAtIndex(size_t index, | 102 void SetUserNameOfProfileAtIndex(size_t index, |
| 102 const base::string16& user_name); | 103 const base::string16& user_name); |
| 103 void SetAvatarIconOfProfileAtIndex(size_t index, size_t icon_index); | 104 void SetAvatarIconOfProfileAtIndex(size_t index, size_t icon_index); |
| 104 void SetIsOmittedProfileAtIndex(size_t index, bool is_omitted); | 105 void SetIsOmittedProfileAtIndex(size_t index, bool is_omitted); |
| 105 void SetManagedUserIdOfProfileAtIndex(size_t index, const std::string& id); | 106 void SetManagedUserIdOfProfileAtIndex(size_t index, const std::string& id); |
| 106 void SetLocalAuthCredentialsOfProfileAtIndex(size_t index, | 107 void SetLocalAuthCredentialsOfProfileAtIndex(size_t index, |
| 107 const std::string& auth); | 108 const std::string& auth); |
| 108 void SetBackgroundStatusOfProfileAtIndex(size_t index, | 109 void SetBackgroundStatusOfProfileAtIndex(size_t index, |
| 109 bool running_background_apps); | 110 bool running_background_apps); |
| 110 void SetGAIANameOfProfileAtIndex(size_t index, const base::string16& name); | 111 void SetGAIANameOfProfileAtIndex(size_t index, const base::string16& name); |
| 111 void SetGAIAGivenNameOfProfileAtIndex(size_t index, | 112 void SetGAIAGivenNameOfProfileAtIndex(size_t index, |
| 112 const base::string16& name); | 113 const base::string16& name); |
| 113 void SetIsUsingGAIANameOfProfileAtIndex(size_t index, bool value); | 114 void SetIsUsingGAIANameOfProfileAtIndex(size_t index, bool value); |
| 114 void SetGAIAPictureOfProfileAtIndex(size_t index, const gfx::Image* image); | 115 void SetGAIAPictureOfProfileAtIndex(size_t index, const gfx::Image* image); |
| 115 void SetIsUsingGAIAPictureOfProfileAtIndex(size_t index, bool value); | 116 void SetIsUsingGAIAPictureOfProfileAtIndex(size_t index, bool value); |
| 116 void SetProfileSigninRequiredAtIndex(size_t index, bool value); | 117 void SetProfileSigninRequiredAtIndex(size_t index, bool value); |
| 117 void SetProfileIsEphemeralAtIndex(size_t index, bool value); | 118 void SetProfileIsEphemeralAtIndex(size_t index, bool value); |
| 119 void SetProfileIsUsingDefaultNameAtIndex(size_t index, bool value); |
| 118 | 120 |
| 119 // Returns unique name that can be assigned to a newly created profile. | 121 // Returns unique name that can be assigned to a newly created profile. |
| 120 base::string16 ChooseNameForNewProfile(size_t icon_index) const; | 122 base::string16 ChooseNameForNewProfile(size_t icon_index) const; |
| 121 | 123 |
| 122 // Checks if the given profile has switched to using GAIA information | 124 // Checks if the given profile has switched to using GAIA information |
| 123 // for the profile name and picture. This pref is used to switch over | 125 // for the profile name and picture. This pref is used to switch over |
| 124 // to GAIA info the first time it is available. Afterwards this pref is | 126 // to GAIA info the first time it is available. Afterwards this pref is |
| 125 // checked to prevent clobbering the user's custom settings. | 127 // checked to prevent clobbering the user's custom settings. |
| 126 bool GetHasMigratedToGAIAInfoOfProfileAtIndex(size_t index) const; | 128 bool GetHasMigratedToGAIAInfoOfProfileAtIndex(size_t index) const; |
| 127 | 129 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 // to be mutable. | 203 // to be mutable. |
| 202 mutable std::map<std::string, gfx::Image*> gaia_pictures_; | 204 mutable std::map<std::string, gfx::Image*> gaia_pictures_; |
| 203 // Marks a gaia profile picture as loading. This prevents a picture from | 205 // Marks a gaia profile picture as loading. This prevents a picture from |
| 204 // loading multiple times. | 206 // loading multiple times. |
| 205 mutable std::map<std::string, bool> gaia_pictures_loading_; | 207 mutable std::map<std::string, bool> gaia_pictures_loading_; |
| 206 | 208 |
| 207 DISALLOW_COPY_AND_ASSIGN(ProfileInfoCache); | 209 DISALLOW_COPY_AND_ASSIGN(ProfileInfoCache); |
| 208 }; | 210 }; |
| 209 | 211 |
| 210 #endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ | 212 #endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ |
| OLD | NEW |