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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 size_t index) const OVERRIDE; | 70 size_t index) const OVERRIDE; |
71 // Note that a return value of false could mean an error in collection or | 71 // Note that a return value of false could mean an error in collection or |
72 // that there are currently no background apps running. However, the action | 72 // that there are currently no background apps running. However, the action |
73 // which results is the same in both cases (thus far). | 73 // which results is the same in both cases (thus far). |
74 virtual bool GetBackgroundStatusOfProfileAtIndex( | 74 virtual bool GetBackgroundStatusOfProfileAtIndex( |
75 size_t index) const OVERRIDE; | 75 size_t index) const OVERRIDE; |
76 virtual base::string16 GetGAIANameOfProfileAtIndex( | 76 virtual base::string16 GetGAIANameOfProfileAtIndex( |
77 size_t index) const OVERRIDE; | 77 size_t index) const OVERRIDE; |
78 virtual base::string16 GetGAIAGivenNameOfProfileAtIndex( | 78 virtual base::string16 GetGAIAGivenNameOfProfileAtIndex( |
79 size_t index) const OVERRIDE; | 79 size_t index) const OVERRIDE; |
80 virtual bool IsUsingGAIANameOfProfileAtIndex(size_t index) const OVERRIDE; | |
81 // Returns the GAIA picture for the given profile. This may return NULL | 80 // Returns the GAIA picture for the given profile. This may return NULL |
82 // if the profile does not have a GAIA picture or if the picture must be | 81 // if the profile does not have a GAIA picture or if the picture must be |
83 // loaded from disk. | 82 // loaded from disk. |
84 virtual const gfx::Image* GetGAIAPictureOfProfileAtIndex( | 83 virtual const gfx::Image* GetGAIAPictureOfProfileAtIndex( |
85 size_t index) const OVERRIDE; | 84 size_t index) const OVERRIDE; |
86 virtual bool IsUsingGAIAPictureOfProfileAtIndex( | 85 virtual bool IsUsingGAIAPictureOfProfileAtIndex( |
87 size_t index) const OVERRIDE; | 86 size_t index) const OVERRIDE; |
88 virtual bool ProfileIsManagedAtIndex(size_t index) const OVERRIDE; | 87 virtual bool ProfileIsManagedAtIndex(size_t index) const OVERRIDE; |
89 virtual bool IsOmittedProfileAtIndex(size_t index) const OVERRIDE; | 88 virtual bool IsOmittedProfileAtIndex(size_t index) const OVERRIDE; |
90 virtual bool ProfileIsSigninRequiredAtIndex(size_t index) const OVERRIDE; | 89 virtual bool ProfileIsSigninRequiredAtIndex(size_t index) const OVERRIDE; |
(...skipping 13 matching lines...) Expand all Loading... |
104 void SetAvatarIconOfProfileAtIndex(size_t index, size_t icon_index); | 103 void SetAvatarIconOfProfileAtIndex(size_t index, size_t icon_index); |
105 void SetIsOmittedProfileAtIndex(size_t index, bool is_omitted); | 104 void SetIsOmittedProfileAtIndex(size_t index, bool is_omitted); |
106 void SetManagedUserIdOfProfileAtIndex(size_t index, const std::string& id); | 105 void SetManagedUserIdOfProfileAtIndex(size_t index, const std::string& id); |
107 void SetLocalAuthCredentialsOfProfileAtIndex(size_t index, | 106 void SetLocalAuthCredentialsOfProfileAtIndex(size_t index, |
108 const std::string& auth); | 107 const std::string& auth); |
109 void SetBackgroundStatusOfProfileAtIndex(size_t index, | 108 void SetBackgroundStatusOfProfileAtIndex(size_t index, |
110 bool running_background_apps); | 109 bool running_background_apps); |
111 void SetGAIANameOfProfileAtIndex(size_t index, const base::string16& name); | 110 void SetGAIANameOfProfileAtIndex(size_t index, const base::string16& name); |
112 void SetGAIAGivenNameOfProfileAtIndex(size_t index, | 111 void SetGAIAGivenNameOfProfileAtIndex(size_t index, |
113 const base::string16& name); | 112 const base::string16& name); |
114 void SetIsUsingGAIANameOfProfileAtIndex(size_t index, bool value); | |
115 void SetGAIAPictureOfProfileAtIndex(size_t index, const gfx::Image* image); | 113 void SetGAIAPictureOfProfileAtIndex(size_t index, const gfx::Image* image); |
116 void SetIsUsingGAIAPictureOfProfileAtIndex(size_t index, bool value); | 114 void SetIsUsingGAIAPictureOfProfileAtIndex(size_t index, bool value); |
117 void SetProfileSigninRequiredAtIndex(size_t index, bool value); | 115 void SetProfileSigninRequiredAtIndex(size_t index, bool value); |
118 void SetProfileIsEphemeralAtIndex(size_t index, bool value); | 116 void SetProfileIsEphemeralAtIndex(size_t index, bool value); |
119 void SetProfileIsUsingDefaultNameAtIndex(size_t index, bool value); | 117 void SetProfileIsUsingDefaultNameAtIndex(size_t index, bool value); |
120 | 118 |
121 // Returns unique name that can be assigned to a newly created profile. | 119 // Returns unique name that can be assigned to a newly created profile. |
122 base::string16 ChooseNameForNewProfile(size_t icon_index) const; | 120 base::string16 ChooseNameForNewProfile(size_t icon_index) const; |
123 | 121 |
124 // Checks if the given profile has switched to using GAIA information | |
125 // for the profile name and picture. This pref is used to switch over | |
126 // to GAIA info the first time it is available. Afterwards this pref is | |
127 // checked to prevent clobbering the user's custom settings. | |
128 bool GetHasMigratedToGAIAInfoOfProfileAtIndex(size_t index) const; | |
129 | |
130 // Marks the given profile as having switched to using GAIA information | |
131 // for the profile name and picture. | |
132 void SetHasMigratedToGAIAInfoOfProfileAtIndex(size_t index, bool value); | |
133 | |
134 // Returns an avatar icon index that can be assigned to a newly created | 122 // Returns an avatar icon index that can be assigned to a newly created |
135 // profile. Note that the icon may not be unique since there are a limited | 123 // profile. Note that the icon may not be unique since there are a limited |
136 // set of default icons. | 124 // set of default icons. |
137 size_t ChooseAvatarIconIndexForNewProfile() const; | 125 size_t ChooseAvatarIconIndexForNewProfile() const; |
138 | 126 |
139 const base::FilePath& GetUserDataDir() const; | 127 const base::FilePath& GetUserDataDir() const; |
140 | 128 |
141 // Gets the number of default avatar icons that exist. | 129 // Gets the number of default avatar icons that exist. |
142 static size_t GetDefaultAvatarIconCount(); | 130 static size_t GetDefaultAvatarIconCount(); |
143 // Gets the resource ID of the default avatar icon at |index|. | 131 // Gets the resource ID of the default avatar icon at |index|. |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 // to be mutable. | 191 // to be mutable. |
204 mutable std::map<std::string, gfx::Image*> gaia_pictures_; | 192 mutable std::map<std::string, gfx::Image*> gaia_pictures_; |
205 // Marks a gaia profile picture as loading. This prevents a picture from | 193 // Marks a gaia profile picture as loading. This prevents a picture from |
206 // loading multiple times. | 194 // loading multiple times. |
207 mutable std::map<std::string, bool> gaia_pictures_loading_; | 195 mutable std::map<std::string, bool> gaia_pictures_loading_; |
208 | 196 |
209 DISALLOW_COPY_AND_ASSIGN(ProfileInfoCache); | 197 DISALLOW_COPY_AND_ASSIGN(ProfileInfoCache); |
210 }; | 198 }; |
211 | 199 |
212 #endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ | 200 #endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ |
OLD | NEW |