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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
121 | 121 |
122 // 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 |
123 // 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 |
124 // set of default icons. | 124 // set of default icons. |
125 size_t ChooseAvatarIconIndexForNewProfile() const; | 125 size_t ChooseAvatarIconIndexForNewProfile() const; |
126 | 126 |
127 const base::FilePath& GetUserDataDir() const; | 127 const base::FilePath& GetUserDataDir() const; |
128 | 128 |
129 // Gets the number of default avatar icons that exist. | 129 // Gets the number of default avatar icons that exist. |
130 static size_t GetDefaultAvatarIconCount(); | 130 static size_t GetDefaultAvatarIconCount(); |
131 // Gets the index for the (grey silhouette) avatar used as a placeholder. | |
132 static int GetPlaceholderAvatarIndex(); | |
131 // Gets the resource ID of the default avatar icon at |index|. | 133 // Gets the resource ID of the default avatar icon at |index|. |
132 static int GetDefaultAvatarIconResourceIDAtIndex(size_t index); | 134 static int GetDefaultAvatarIconResourceIDAtIndex(size_t index); |
135 // Gets the resource ID of the placeholder avatar icon. | |
136 static int GetPlaceholderAvatarIconResourceID(); | |
noms (inactive)
2014/03/27 20:19:32
Why do you need both methods? Isn't GetPlaceholde
Mike Lerman
2014/04/02 17:46:25
Yes, but this removes the need to have those two n
| |
133 // Returns a URL for the default avatar icon with specified index. | 137 // Returns a URL for the default avatar icon with specified index. |
134 static std::string GetDefaultAvatarIconUrl(size_t index); | 138 static std::string GetDefaultAvatarIconUrl(size_t index); |
135 // Checks if |index| is a valid avatar icon index | 139 // Checks if |index| is a valid avatar icon index |
136 static bool IsDefaultAvatarIconIndex(size_t index); | 140 static bool IsDefaultAvatarIconIndex(size_t index); |
137 // Checks if the given URL points to one of the default avatar icons. If it | 141 // Checks if the given URL points to one of the default avatar icons. If it |
138 // is, returns true and its index through |icon_index|. If not, returns false. | 142 // is, returns true and its index through |icon_index|. If not, returns false. |
139 static bool IsDefaultAvatarIconUrl(const std::string& icon_url, | 143 static bool IsDefaultAvatarIconUrl(const std::string& icon_url, |
140 size_t *icon_index); | 144 size_t *icon_index); |
141 | 145 |
142 // Gets all names of profiles associated with this instance of Chrome. | 146 // Gets all names of profiles associated with this instance of Chrome. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
191 // to be mutable. | 195 // to be mutable. |
192 mutable std::map<std::string, gfx::Image*> gaia_pictures_; | 196 mutable std::map<std::string, gfx::Image*> gaia_pictures_; |
193 // Marks a gaia profile picture as loading. This prevents a picture from | 197 // Marks a gaia profile picture as loading. This prevents a picture from |
194 // loading multiple times. | 198 // loading multiple times. |
195 mutable std::map<std::string, bool> gaia_pictures_loading_; | 199 mutable std::map<std::string, bool> gaia_pictures_loading_; |
196 | 200 |
197 DISALLOW_COPY_AND_ASSIGN(ProfileInfoCache); | 201 DISALLOW_COPY_AND_ASSIGN(ProfileInfoCache); |
198 }; | 202 }; |
199 | 203 |
200 #endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ | 204 #endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ |
OLD | NEW |