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

Unified Diff: chrome/browser/ui/webui/ntp/ntp_login_handler.cc

Issue 33753002: Sooper experimental refactoring of the profile info cache. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 7 years, 2 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/ui/webui/ntp/ntp_login_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
index 35a31b00d772c434a476ffda9619318342174343..4fca50ad3118d3f81c175ad0c0018f58e3eb5cc8 100644
--- a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
@@ -206,17 +206,18 @@ void NTPLoginHandler::UpdateLogin() {
if (!username.empty()) {
ProfileInfoCache& cache =
g_browser_process->profile_manager()->GetProfileInfoCache();
- size_t profile_index = cache.GetIndexOfProfileWithPath(profile->GetPath());
- if (profile_index != std::string::npos) {
+
+ ProfileInfoEntry entry;
+ if (cache.GetInfoForProfile(profile->GetPath(), &entry)) {
// Only show the profile picture and full name for the single profile
// case. In the multi-profile case the profile picture is visible in the
// title bar and the full name can be ambiguous.
if (cache.GetNumberOfProfiles() == 1) {
- string16 name = cache.GetGAIANameOfProfileAtIndex(profile_index);
+ string16 name = entry.GAIA_full_name();
if (!name.empty())
header = CreateSpanWithClass(name, "profile-name");
const gfx::Image* image =
- cache.GetGAIAPictureOfProfileAtIndex(profile_index);
+ cache.GetGAIAPictureOfProfile(entry.path());
if (image)
icon_url = webui::GetBitmapDataUrl(GetGAIAPictureForNTP(*image));
}
« no previous file with comments | « chrome/browser/ui/views/profile_chooser_view.cc ('k') | chrome/browser/ui/webui/options/browser_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698