| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 bool GetStatisticOfProfileAtIndex(size_t index, const std::string& category, |
| 109 int* out_value) const; |
| 110 std::map<std::string, int> GetAllStatisticOfProfileAtIndex(size_t index) |
| 111 const; |
| 112 scoped_ptr<base::DictionaryValue> |
| 113 GetAllStatisticsOfProfileAtIndexAsDictionaryValue(size_t index) const; |
| 114 |
| 108 void SetProfileActiveTimeAtIndex(size_t index); | 115 void SetProfileActiveTimeAtIndex(size_t index); |
| 109 // Warning: This will re-sort profiles and thus may change indices! | 116 // Warning: This will re-sort profiles and thus may change indices! |
| 110 void SetNameOfProfileAtIndex(size_t index, const base::string16& name); | 117 void SetNameOfProfileAtIndex(size_t index, const base::string16& name); |
| 111 void SetShortcutNameOfProfileAtIndex(size_t index, | 118 void SetShortcutNameOfProfileAtIndex(size_t index, |
| 112 const base::string16& name); | 119 const base::string16& name); |
| 113 void SetAuthInfoOfProfileAtIndex(size_t index, | 120 void SetAuthInfoOfProfileAtIndex(size_t index, |
| 114 const std::string& gaia_id, | 121 const std::string& gaia_id, |
| 115 const base::string16& user_name); | 122 const base::string16& user_name); |
| 116 void SetAvatarIconOfProfileAtIndex(size_t index, size_t icon_index); | 123 void SetAvatarIconOfProfileAtIndex(size_t index, size_t icon_index); |
| 117 void SetIsOmittedProfileAtIndex(size_t index, bool is_omitted); | 124 void SetIsOmittedProfileAtIndex(size_t index, bool is_omitted); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 139 bool IsDefaultProfileName(const base::string16& name) const; | 146 bool IsDefaultProfileName(const base::string16& name) const; |
| 140 | 147 |
| 141 // Returns unique name that can be assigned to a newly created profile. | 148 // Returns unique name that can be assigned to a newly created profile. |
| 142 base::string16 ChooseNameForNewProfile(size_t icon_index) const; | 149 base::string16 ChooseNameForNewProfile(size_t icon_index) const; |
| 143 | 150 |
| 144 // Returns an avatar icon index that can be assigned to a newly created | 151 // 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 | 152 // profile. Note that the icon may not be unique since there are a limited |
| 146 // set of default icons. | 153 // set of default icons. |
| 147 size_t ChooseAvatarIconIndexForNewProfile() const; | 154 size_t ChooseAvatarIconIndexForNewProfile() const; |
| 148 | 155 |
| 156 void SetStatisticOfProfileAtIndex(size_t index, const std::string& category, |
| 157 int value); |
| 158 |
| 149 const base::FilePath& GetUserDataDir() const; | 159 const base::FilePath& GetUserDataDir() const; |
| 150 | 160 |
| 151 // Register cache related preferences in Local State. | 161 // Register cache related preferences in Local State. |
| 152 static void RegisterPrefs(PrefRegistrySimple* registry); | 162 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 153 | 163 |
| 154 // Checks whether the high res avatar at index |icon_index| exists, and | 164 // Checks whether the high res avatar at index |icon_index| exists, and |
| 155 // if it does not, calls |DownloadHighResAvatar|. | 165 // if it does not, calls |DownloadHighResAvatar|. |
| 156 void DownloadHighResAvatarIfNeeded(size_t icon_index, | 166 void DownloadHighResAvatarIfNeeded(size_t icon_index, |
| 157 const base::FilePath& profile_path); | 167 const base::FilePath& profile_path); |
| 158 | 168 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 avatar_images_downloads_in_progress_; | 278 avatar_images_downloads_in_progress_; |
| 269 | 279 |
| 270 // Determines of the ProfileAvatarDownloader should be created and executed | 280 // Determines of the ProfileAvatarDownloader should be created and executed |
| 271 // or not. Only set to true for tests. | 281 // or not. Only set to true for tests. |
| 272 bool disable_avatar_download_for_testing_; | 282 bool disable_avatar_download_for_testing_; |
| 273 | 283 |
| 274 DISALLOW_COPY_AND_ASSIGN(ProfileInfoCache); | 284 DISALLOW_COPY_AND_ASSIGN(ProfileInfoCache); |
| 275 }; | 285 }; |
| 276 | 286 |
| 277 #endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ | 287 #endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ |
| OLD | NEW |