Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: chrome/browser/profiles/profile_info_cache.h

Issue 895803003: [Profiles] Remove the NotificationService from the ProfileInfoCache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/profiles/avatar_menu.cc ('k') | chrome/browser/profiles/profile_info_cache.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 const base::FilePath& profile_path); 146 const base::FilePath& profile_path);
147 147
148 void AddObserver(ProfileInfoCacheObserver* obs); 148 void AddObserver(ProfileInfoCacheObserver* obs);
149 void RemoveObserver(ProfileInfoCacheObserver* obs); 149 void RemoveObserver(ProfileInfoCacheObserver* obs);
150 150
151 private: 151 private:
152 FRIEND_TEST_ALL_PREFIXES(ProfileInfoCacheTest, DownloadHighResAvatarTest); 152 FRIEND_TEST_ALL_PREFIXES(ProfileInfoCacheTest, DownloadHighResAvatarTest);
153 153
154 const base::DictionaryValue* GetInfoForProfileAtIndex(size_t index) const; 154 const base::DictionaryValue* GetInfoForProfileAtIndex(size_t index) const;
155 // Saves the profile info to a cache and takes ownership of |info|. 155 // Saves the profile info to a cache and takes ownership of |info|.
156 // Currently the only information that is cached is the profile's name,
157 // user name, and avatar icon.
158 void SetInfoQuietlyForProfileAtIndex(size_t index,
159 base::DictionaryValue* info);
160 void SetInfoForProfileAtIndex(size_t index, base::DictionaryValue* info); 156 void SetInfoForProfileAtIndex(size_t index, base::DictionaryValue* info);
161 std::string CacheKeyFromProfilePath(const base::FilePath& profile_path) const; 157 std::string CacheKeyFromProfilePath(const base::FilePath& profile_path) const;
162 std::vector<std::string>::iterator FindPositionForProfile( 158 std::vector<std::string>::iterator FindPositionForProfile(
163 const std::string& search_key, 159 const std::string& search_key,
164 const base::string16& search_name); 160 const base::string16& search_name);
165 161
166 // Returns true if the given icon index is not in use by another profie. 162 // Returns true if the given icon index is not in use by another profie.
167 bool IconIndexIsUnique(size_t icon_index) const; 163 bool IconIndexIsUnique(size_t icon_index) const;
168 164
169 // Tries to find an icon index that satisfies all the given conditions. 165 // Tries to find an icon index that satisfies all the given conditions.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 // This prevents a picture from being downloaded multiple times. The 221 // This prevents a picture from being downloaded multiple times. The
226 // ProfileAvatarDownloader instances are deleted when the download completes 222 // ProfileAvatarDownloader instances are deleted when the download completes
227 // or when the ProfileInfoCache is destroyed. 223 // or when the ProfileInfoCache is destroyed.
228 std::map<std::string, ProfileAvatarDownloader*> 224 std::map<std::string, ProfileAvatarDownloader*>
229 avatar_images_downloads_in_progress_; 225 avatar_images_downloads_in_progress_;
230 226
231 DISALLOW_COPY_AND_ASSIGN(ProfileInfoCache); 227 DISALLOW_COPY_AND_ASSIGN(ProfileInfoCache);
232 }; 228 };
233 229
234 #endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ 230 #endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_
OLDNEW
« no previous file with comments | « chrome/browser/profiles/avatar_menu.cc ('k') | chrome/browser/profiles/profile_info_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698