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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // Returns unique name that can be assigned to a newly created profile. | 122 // Returns unique name that can be assigned to a newly created profile. |
123 base::string16 ChooseNameForNewProfile(size_t icon_index) const; | 123 base::string16 ChooseNameForNewProfile(size_t icon_index) const; |
124 | 124 |
125 // Returns an avatar icon index that can be assigned to a newly created | 125 // Returns an avatar icon index that can be assigned to a newly created |
126 // profile. Note that the icon may not be unique since there are a limited | 126 // profile. Note that the icon may not be unique since there are a limited |
127 // set of default icons. | 127 // set of default icons. |
128 size_t ChooseAvatarIconIndexForNewProfile() const; | 128 size_t ChooseAvatarIconIndexForNewProfile() const; |
129 | 129 |
130 const base::FilePath& GetUserDataDir() const; | 130 const base::FilePath& GetUserDataDir() const; |
131 | 131 |
132 // Gets all names of profiles associated with this instance of Chrome. | |
133 // Because this method will be called during uninstall, before the creation | |
134 // of the ProfileManager, it reads directly from the local state preferences, | |
135 // rather than going through the ProfileInfoCache object. | |
136 static std::vector<base::string16> GetProfileNames(); | |
137 | |
138 // Register cache related preferences in Local State. | 132 // Register cache related preferences in Local State. |
139 static void RegisterPrefs(PrefRegistrySimple* registry); | 133 static void RegisterPrefs(PrefRegistrySimple* registry); |
140 | 134 |
141 // Checks whether the high res avatar at index |icon_index| exists, and | 135 // Checks whether the high res avatar at index |icon_index| exists, and |
142 // if it does not, calls |DownloadHighResAvatar|. | 136 // if it does not, calls |DownloadHighResAvatar|. |
143 void DownloadHighResAvatarIfNeeded(size_t icon_index, | 137 void DownloadHighResAvatarIfNeeded(size_t icon_index, |
144 const base::FilePath& profile_path); | 138 const base::FilePath& profile_path); |
145 | 139 |
146 // Saves the avatar |image| at |image_path|. This is used both for the | 140 // Saves the avatar |image| at |image_path|. This is used both for the |
147 // GAIA profile pictures and the ProfileAvatarDownloader that is used to | 141 // GAIA profile pictures and the ProfileAvatarDownloader that is used to |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 // This prevents a picture from being downloaded multiple times. The | 225 // This prevents a picture from being downloaded multiple times. The |
232 // ProfileAvatarDownloader instances are deleted when the download completes | 226 // ProfileAvatarDownloader instances are deleted when the download completes |
233 // or when the ProfileInfoCache is destroyed. | 227 // or when the ProfileInfoCache is destroyed. |
234 std::map<std::string, ProfileAvatarDownloader*> | 228 std::map<std::string, ProfileAvatarDownloader*> |
235 avatar_images_downloads_in_progress_; | 229 avatar_images_downloads_in_progress_; |
236 | 230 |
237 DISALLOW_COPY_AND_ASSIGN(ProfileInfoCache); | 231 DISALLOW_COPY_AND_ASSIGN(ProfileInfoCache); |
238 }; | 232 }; |
239 | 233 |
240 #endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ | 234 #endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ |
OLD | NEW |