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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/profiles/profile_impl.h" 5 #include "chrome/browser/profiles/profile_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/environment.h" 10 #include "base/environment.h"
(...skipping 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after
1593 1593
1594 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { 1594 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() {
1595 if (!spellcheck_profile_.get()) 1595 if (!spellcheck_profile_.get())
1596 spellcheck_profile_.reset(new SpellCheckProfile(path_)); 1596 spellcheck_profile_.reset(new SpellCheckProfile(path_));
1597 return spellcheck_profile_.get(); 1597 return spellcheck_profile_.get();
1598 } 1598 }
1599 1599
1600 void ProfileImpl::UpdateProfileUserNameCache() { 1600 void ProfileImpl::UpdateProfileUserNameCache() {
1601 ProfileManager* profile_manager = g_browser_process->profile_manager(); 1601 ProfileManager* profile_manager = g_browser_process->profile_manager();
1602 ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); 1602 ProfileInfoCache& cache = profile_manager->GetProfileInfoCache();
1603 size_t index = cache.GetIndexOfProfileWithPath(GetPath()); 1603 ProfileInfoEntry entry;
1604 if (index != std::string::npos) { 1604 if (cache.GetInfoForProfile(GetPath(), &entry)) {
1605 std::string user_name = 1605 string16 user_name =
1606 GetPrefs()->GetString(prefs::kGoogleServicesUsername); 1606 UTF8ToUTF16(GetPrefs()->GetString(prefs::kGoogleServicesUsername));
1607 cache.SetUserNameOfProfileAtIndex(index, UTF8ToUTF16(user_name)); 1607 entry.set_user_name(user_name);
1608 cache.SetInfoForProfile(entry);
1608 } 1609 }
1609 } 1610 }
OLDNEW
« 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