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

Unified Diff: chrome/browser/profiles/profile_attributes_entry.cc

Issue 1415223002: Add counts of User data to ProfileInfoCache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/profile_attributes_entry.cc
diff --git a/chrome/browser/profiles/profile_attributes_entry.cc b/chrome/browser/profiles/profile_attributes_entry.cc
index 8c9757615c933feaeb5279174789b98d6d7d6b2e..b1dba54276acf8b281dc0f0ecfd73c770bd21896 100644
--- a/chrome/browser/profiles/profile_attributes_entry.cc
+++ b/chrome/browser/profiles/profile_attributes_entry.cc
@@ -130,6 +130,22 @@ size_t ProfileAttributesEntry::GetAvatarIconIndex() const {
profile_index());
}
+bool ProfileAttributesEntry::GetStatistic(const std::string& category,
+ int* out_value) const {
+ return profile_info_cache_->GetStatisticOfProfileAtIndex(
+ profile_index(), category, out_value);
+}
+
+std::map<std::string, int> ProfileAttributesEntry::GetAllStatistics() const {
+ return profile_info_cache_->GetAllStatisticOfProfileAtIndex(profile_index());
+}
+
+scoped_ptr<base::DictionaryValue>
+ ProfileAttributesEntry::GetAllStatisticsAsDictionaryValue() const {
+ return profile_info_cache_->GetAllStatisticsOfProfileAtIndexAsDictionaryValue(
+ profile_index()).Pass();
+}
+
void ProfileAttributesEntry::SetName(const base::string16& name) {
profile_info_cache_->SetNameOfProfileAtIndex(profile_index(), name);
}
@@ -206,6 +222,12 @@ void ProfileAttributesEntry::SetAvatarIconIndex(size_t icon_index) {
profile_index(), icon_index);
}
+void ProfileAttributesEntry::SetStatistic(const std::string& category,
+ int value) {
+ profile_info_cache_->SetStatisticOfProfileAtIndex(
+ profile_index(), category, value);
+}
+
void ProfileAttributesEntry::SetAuthInfo(
const std::string& gaia_id, const base::string16& user_name) {
profile_info_cache_->SetAuthInfoOfProfileAtIndex(

Powered by Google App Engine
This is Rietveld 408576698