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

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

Issue 1415223002: Add counts of User data to ProfileInfoCache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bug fix. Removed a non-trivial style fix (will upload in another CL). Created 5 years, 1 month 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
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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 bool ProfileIsSigninRequiredAtIndex(size_t index) const override; 98 bool ProfileIsSigninRequiredAtIndex(size_t index) const override;
99 std::string GetSupervisedUserIdOfProfileAtIndex(size_t index) const override; 99 std::string GetSupervisedUserIdOfProfileAtIndex(size_t index) const override;
100 bool ProfileIsEphemeralAtIndex(size_t index) const override; 100 bool ProfileIsEphemeralAtIndex(size_t index) const override;
101 bool ProfileIsUsingDefaultNameAtIndex(size_t index) const override; 101 bool ProfileIsUsingDefaultNameAtIndex(size_t index) const override;
102 bool ProfileIsAuthenticatedAtIndex(size_t index) const override; 102 bool ProfileIsAuthenticatedAtIndex(size_t index) const override;
103 bool ProfileIsUsingDefaultAvatarAtIndex(size_t index) const override; 103 bool ProfileIsUsingDefaultAvatarAtIndex(size_t index) const override;
104 bool ProfileIsAuthErrorAtIndex(size_t index) const; 104 bool ProfileIsAuthErrorAtIndex(size_t index) const;
105 105
106 size_t GetAvatarIconIndexOfProfileAtIndex(size_t index) const; 106 size_t GetAvatarIconIndexOfProfileAtIndex(size_t index) const;
107 107
108 // Statistics
109 bool HasStatsBrowsingHistoryOfProfileAtIndex(size_t index) const;
110 int GetStatsBrowsingHistoryOfProfileAtIndex(size_t index) const;
111 bool HasStatsPasswordsOfProfileAtIndex(size_t index) const;
112 int GetStatsPasswordsOfProfileAtIndex(size_t index) const;
113 bool HasStatsBookmarksOfProfileAtIndex(size_t index) const;
114 int GetStatsBookmarksOfProfileAtIndex(size_t index) const;
115 bool HasStatsSettingsOfProfileAtIndex(size_t index) const;
116 int GetStatsSettingsOfProfileAtIndex(size_t index) const;
117
108 void SetProfileActiveTimeAtIndex(size_t index); 118 void SetProfileActiveTimeAtIndex(size_t index);
109 // Warning: This will re-sort profiles and thus may change indices! 119 // Warning: This will re-sort profiles and thus may change indices!
110 void SetNameOfProfileAtIndex(size_t index, const base::string16& name); 120 void SetNameOfProfileAtIndex(size_t index, const base::string16& name);
111 void SetShortcutNameOfProfileAtIndex(size_t index, 121 void SetShortcutNameOfProfileAtIndex(size_t index,
112 const base::string16& name); 122 const base::string16& name);
113 void SetAuthInfoOfProfileAtIndex(size_t index, 123 void SetAuthInfoOfProfileAtIndex(size_t index,
114 const std::string& gaia_id, 124 const std::string& gaia_id,
115 const base::string16& user_name); 125 const base::string16& user_name);
116 void SetAvatarIconOfProfileAtIndex(size_t index, size_t icon_index); 126 void SetAvatarIconOfProfileAtIndex(size_t index, size_t icon_index);
117 void SetIsOmittedProfileAtIndex(size_t index, bool is_omitted); 127 void SetIsOmittedProfileAtIndex(size_t index, bool is_omitted);
(...skipping 21 matching lines...) Expand all
139 bool IsDefaultProfileName(const base::string16& name) const; 149 bool IsDefaultProfileName(const base::string16& name) const;
140 150
141 // Returns unique name that can be assigned to a newly created profile. 151 // Returns unique name that can be assigned to a newly created profile.
142 base::string16 ChooseNameForNewProfile(size_t icon_index) const; 152 base::string16 ChooseNameForNewProfile(size_t icon_index) const;
143 153
144 // Returns an avatar icon index that can be assigned to a newly created 154 // Returns an avatar icon index that can be assigned to a newly created
145 // profile. Note that the icon may not be unique since there are a limited 155 // profile. Note that the icon may not be unique since there are a limited
146 // set of default icons. 156 // set of default icons.
147 size_t ChooseAvatarIconIndexForNewProfile() const; 157 size_t ChooseAvatarIconIndexForNewProfile() const;
148 158
159 // Statistics
160 void SetStatsBrowsingHistoryOfProfileAtIndex(size_t index, int value);
161 void SetStatsPasswordsOfProfileAtIndex(size_t index, int value);
162 void SetStatsBookmarksOfProfileAtIndex(size_t index, int value);
163 void SetStatsSettingsOfProfileAtIndex(size_t index, int value);
164
149 const base::FilePath& GetUserDataDir() const; 165 const base::FilePath& GetUserDataDir() const;
150 166
151 // Register cache related preferences in Local State. 167 // Register cache related preferences in Local State.
152 static void RegisterPrefs(PrefRegistrySimple* registry); 168 static void RegisterPrefs(PrefRegistrySimple* registry);
153 169
154 // Checks whether the high res avatar at index |icon_index| exists, and 170 // Checks whether the high res avatar at index |icon_index| exists, and
155 // if it does not, calls |DownloadHighResAvatar|. 171 // if it does not, calls |DownloadHighResAvatar|.
156 void DownloadHighResAvatarIfNeeded(size_t icon_index, 172 void DownloadHighResAvatarIfNeeded(size_t icon_index,
157 const base::FilePath& profile_path); 173 const base::FilePath& profile_path);
158 174
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 avatar_images_downloads_in_progress_; 284 avatar_images_downloads_in_progress_;
269 285
270 // Determines of the ProfileAvatarDownloader should be created and executed 286 // Determines of the ProfileAvatarDownloader should be created and executed
271 // or not. Only set to true for tests. 287 // or not. Only set to true for tests.
272 bool disable_avatar_download_for_testing_; 288 bool disable_avatar_download_for_testing_;
273 289
274 DISALLOW_COPY_AND_ASSIGN(ProfileInfoCache); 290 DISALLOW_COPY_AND_ASSIGN(ProfileInfoCache);
275 }; 291 };
276 292
277 #endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ 293 #endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_attributes_storage_unittest.cc ('k') | chrome/browser/profiles/profile_info_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698