| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 size_t ChooseAvatarIconIndexForNewProfile() const; | 98 size_t ChooseAvatarIconIndexForNewProfile() const; |
| 99 | 99 |
| 100 const FilePath& GetUserDataDir() const; | 100 const FilePath& GetUserDataDir() const; |
| 101 | 101 |
| 102 // Gets the number of default avatar icons that exist. | 102 // Gets the number of default avatar icons that exist. |
| 103 static size_t GetDefaultAvatarIconCount(); | 103 static size_t GetDefaultAvatarIconCount(); |
| 104 // Gets the resource ID of the default avatar icon at |index|. | 104 // Gets the resource ID of the default avatar icon at |index|. |
| 105 static int GetDefaultAvatarIconResourceIDAtIndex(size_t index); | 105 static int GetDefaultAvatarIconResourceIDAtIndex(size_t index); |
| 106 // Returns a URL for the default avatar icon with specified index. | 106 // Returns a URL for the default avatar icon with specified index. |
| 107 static std::string GetDefaultAvatarIconUrl(size_t index); | 107 static std::string GetDefaultAvatarIconUrl(size_t index); |
| 108 // Checks if |index| is a valid avatar icon index |
| 109 static bool IsDefaultAvatarIconIndex(size_t index); |
| 108 // Checks if the given URL points to one of the default avatar icons. If it | 110 // Checks if the given URL points to one of the default avatar icons. If it |
| 109 // is, returns true and its index through |icon_index|. If not, returns false. | 111 // is, returns true and its index through |icon_index|. If not, returns false. |
| 110 static bool IsDefaultAvatarIconUrl(const std::string& icon_url, | 112 static bool IsDefaultAvatarIconUrl(const std::string& icon_url, |
| 111 size_t *icon_index); | 113 size_t *icon_index); |
| 112 | 114 |
| 113 // Gets all names of profiles associated with this instance of Chrome. | 115 // Gets all names of profiles associated with this instance of Chrome. |
| 114 // Because this method will be called during uninstall, before the creation | 116 // Because this method will be called during uninstall, before the creation |
| 115 // of the ProfileManager, it reads directly from the local state preferences, | 117 // of the ProfileManager, it reads directly from the local state preferences, |
| 116 // rather than going through the ProfileInfoCache object. | 118 // rather than going through the ProfileInfoCache object. |
| 117 static std::vector<string16> GetProfileNames(); | 119 static std::vector<string16> GetProfileNames(); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 // to be mutable. | 161 // to be mutable. |
| 160 mutable std::map<std::string, gfx::Image*> gaia_pictures_; | 162 mutable std::map<std::string, gfx::Image*> gaia_pictures_; |
| 161 // Marks a gaia profile picture as loading. This prevents a picture from | 163 // Marks a gaia profile picture as loading. This prevents a picture from |
| 162 // loading multiple times. | 164 // loading multiple times. |
| 163 mutable std::map<std::string, bool> gaia_pictures_loading_; | 165 mutable std::map<std::string, bool> gaia_pictures_loading_; |
| 164 | 166 |
| 165 DISALLOW_COPY_AND_ASSIGN(ProfileInfoCache); | 167 DISALLOW_COPY_AND_ASSIGN(ProfileInfoCache); |
| 166 }; | 168 }; |
| 167 | 169 |
| 168 #endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ | 170 #endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ |
| OLD | NEW |