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

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: Headers cleanup 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
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..126675131dcae5b33a3caca7f6143ae29d3719df 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 kAuthErrorKey[] = "auth_error";
noms (inactive) 2015/01/08 21:49:04 nit: now that it's a boolean, is_auth_error would
Mike Lerman 2015/01/09 02:15:04 Done.
// 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(kAuthErrorKey, &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(kAuthErrorKey, 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) ||

Powered by Google App Engine
This is Rietveld 408576698