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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 void AddObserver(ProfileInfoCacheObserver* obs); | 152 void AddObserver(ProfileInfoCacheObserver* obs); |
153 void RemoveObserver(ProfileInfoCacheObserver* obs); | 153 void RemoveObserver(ProfileInfoCacheObserver* obs); |
154 | 154 |
155 void set_disable_avatar_download_for_testing( | 155 void set_disable_avatar_download_for_testing( |
156 bool disable_avatar_download_for_testing) { | 156 bool disable_avatar_download_for_testing) { |
157 disable_avatar_download_for_testing_ = disable_avatar_download_for_testing; | 157 disable_avatar_download_for_testing_ = disable_avatar_download_for_testing; |
158 } | 158 } |
159 | 159 |
160 private: | 160 private: |
161 FRIEND_TEST_ALL_PREFIXES(ProfileInfoCacheTest, DownloadHighResAvatarTest); | 161 FRIEND_TEST_ALL_PREFIXES(ProfileInfoCacheTest, DownloadHighResAvatarTest); |
| 162 FRIEND_TEST_ALL_PREFIXES(ProfileInfoCacheTest, |
| 163 NothingToDownloadHighResAvatarTest); |
162 | 164 |
163 const base::DictionaryValue* GetInfoForProfileAtIndex(size_t index) const; | 165 const base::DictionaryValue* GetInfoForProfileAtIndex(size_t index) const; |
164 // Saves the profile info to a cache and takes ownership of |info|. | 166 // Saves the profile info to a cache and takes ownership of |info|. |
165 void SetInfoForProfileAtIndex(size_t index, base::DictionaryValue* info); | 167 void SetInfoForProfileAtIndex(size_t index, base::DictionaryValue* info); |
166 std::string CacheKeyFromProfilePath(const base::FilePath& profile_path) const; | 168 std::string CacheKeyFromProfilePath(const base::FilePath& profile_path) const; |
167 std::vector<std::string>::iterator FindPositionForProfile( | 169 std::vector<std::string>::iterator FindPositionForProfile( |
168 const std::string& search_key, | 170 const std::string& search_key, |
169 const base::string16& search_name); | 171 const base::string16& search_name); |
170 | 172 |
171 // Returns true if the given icon index is not in use by another profie. | 173 // Returns true if the given icon index is not in use by another profie. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 avatar_images_downloads_in_progress_; | 236 avatar_images_downloads_in_progress_; |
235 | 237 |
236 // Determines of the ProfileAvatarDownloader should be created and executed | 238 // Determines of the ProfileAvatarDownloader should be created and executed |
237 // or not. Only set to true for tests. | 239 // or not. Only set to true for tests. |
238 bool disable_avatar_download_for_testing_; | 240 bool disable_avatar_download_for_testing_; |
239 | 241 |
240 DISALLOW_COPY_AND_ASSIGN(ProfileInfoCache); | 242 DISALLOW_COPY_AND_ASSIGN(ProfileInfoCache); |
241 }; | 243 }; |
242 | 244 |
243 #endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ | 245 #endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ |
OLD | NEW |