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) || |