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

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

Issue 813133003: New Profile metric for Auth Errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ChromeSigninClient handles no ProfileManager for tests Created 5 years, 11 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
« no previous file with comments | « chrome/browser/profiles/profile_info_cache.h ('k') | chrome/browser/profiles/profile_metrics.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_info_cache.cc
diff --git a/chrome/browser/profiles/profile_info_cache.cc b/chrome/browser/profiles/profile_info_cache.cc
index 4e6803e2ceb57727fbdd9386df1918ab01c384ac..6ba81df7bdac7f6a9da76a3472bf7534d776169b 100644
--- a/chrome/browser/profiles/profile_info_cache.cc
+++ b/chrome/browser/profiles/profile_info_cache.cc
@@ -58,6 +58,7 @@ const char kSigninRequiredKey[] = "signin_required";
const char kSupervisedUserId[] = "managed_user_id";
const char kProfileIsEphemeral[] = "is_ephemeral";
const char kActiveTimeKey[] = "active_time";
+const char kIsAuthErrorKey[] = "is_auth_error";
// First eight are generic icons, which use IDS_NUMBERED_PROFILE_NAME.
const int kDefaultNames[] = {
@@ -455,6 +456,12 @@ bool ProfileInfoCache::ProfileIsUsingDefaultAvatarAtIndex(size_t index) const {
return value;
}
+bool ProfileInfoCache::ProfileIsAuthErrorAtIndex(size_t index) const {
+ bool value = false;
+ GetInfoForProfileAtIndex(index)->GetBoolean(kIsAuthErrorKey, &value);
+ return value;
+}
+
size_t ProfileInfoCache::GetAvatarIconIndexOfProfileAtIndex(size_t index)
const {
std::string icon_url;
@@ -752,6 +759,17 @@ void ProfileInfoCache::SetProfileIsUsingDefaultAvatarAtIndex(
SetInfoForProfileAtIndex(index, info.release());
}
+void ProfileInfoCache::SetProfileIsAuthErrorAtIndex(size_t index, bool value) {
+ if (value == ProfileIsAuthErrorAtIndex(index))
+ return;
+
+ scoped_ptr<base::DictionaryValue> info(
+ GetInfoForProfileAtIndex(index)->DeepCopy());
+ info->SetBoolean(kIsAuthErrorKey, value);
+ // This takes ownership of |info|.
+ SetInfoForProfileAtIndex(index, info.release());
+}
+
bool ProfileInfoCache::IsDefaultProfileName(const base::string16& name) const {
// Check if it's a "First user" old-style name.
if (name == l10n_util::GetStringUTF16(IDS_DEFAULT_PROFILE_NAME) ||
« no previous file with comments | « chrome/browser/profiles/profile_info_cache.h ('k') | chrome/browser/profiles/profile_metrics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698