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

Unified Diff: chrome/browser/profiles/avatar_menu_desktop.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/profiles/avatar_menu_desktop.cc
diff --git a/chrome/browser/profiles/avatar_menu_desktop.cc b/chrome/browser/profiles/avatar_menu_desktop.cc
index 35949a5ef7ec71e3733745a0633c68251d9654ab..117a1cf4de354e71e3bac123ece1e518885680fe 100644
--- a/chrome/browser/profiles/avatar_menu_desktop.cc
+++ b/chrome/browser/profiles/avatar_menu_desktop.cc
@@ -15,14 +15,15 @@ void AvatarMenu::GetImageForMenuButton(Profile* profile,
bool* is_rectangle) {
ProfileInfoCache& cache =
g_browser_process->profile_manager()->GetProfileInfoCache();
- size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath());
- if (index == std::string::npos) {
+
+ ProfileInfoEntry entry;
+ if (!cache.GetInfoForProfile(profile->GetPath(), &entry)) {
NOTREACHED();
return;
}
- *image = cache.GetAvatarIconOfProfileAtIndex(index);
+ *image = cache.GetAvatarIconOfProfile(entry.path());
*is_rectangle =
- cache.IsUsingGAIAPictureOfProfileAtIndex(index) &&
- cache.GetGAIAPictureOfProfileAtIndex(index);
+ entry.is_using_GAIA_picture() &&
+ cache.GetGAIAPictureOfProfile(entry.path());
}
« no previous file with comments | « chrome/browser/profiles/avatar_menu_actions_desktop.cc ('k') | chrome/browser/profiles/gaia_info_update_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698