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

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

Issue 8539043: Refactor ProfileInfoCache (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/avatar_menu_model.cc ('k') | chrome/browser/profiles/profile_info_cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_impl.cc
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index c6eb3f6193e556de6e5bac0df734ff6a0663c67f..5ab24d22060938a3a0e93c85f078522667339a27 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -1600,10 +1600,11 @@ SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() {
void ProfileImpl::UpdateProfileUserNameCache() {
ProfileManager* profile_manager = g_browser_process->profile_manager();
ProfileInfoCache& cache = profile_manager->GetProfileInfoCache();
- size_t index = cache.GetIndexOfProfileWithPath(GetPath());
- if (index != std::string::npos) {
- std::string user_name =
- GetPrefs()->GetString(prefs::kGoogleServicesUsername);
- cache.SetUserNameOfProfileAtIndex(index, UTF8ToUTF16(user_name));
+ ProfileInfoEntry entry;
+ if (cache.GetInfoForProfile(GetPath(), &entry)) {
+ string16 user_name =
+ UTF8ToUTF16(GetPrefs()->GetString(prefs::kGoogleServicesUsername));
+ entry.set_user_name(user_name);
+ cache.SetInfoForProfile(entry);
}
}
« no previous file with comments | « chrome/browser/profiles/avatar_menu_model.cc ('k') | chrome/browser/profiles/profile_info_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698