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

Unified Diff: chrome/browser/ui/views/profiles/avatar_menu_button.cc

Issue 1701563002: Refactor ProfileInfoCache in c/b/ui/views (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to comments Created 4 years, 10 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/views/profiles/avatar_menu_button.cc
diff --git a/chrome/browser/ui/views/profiles/avatar_menu_button.cc b/chrome/browser/ui/views/profiles/avatar_menu_button.cc
index 66d7a81643bd08749e2149a4b22df47585d8988c..c5d3f08b403c6826633e28ba0e5819d16b95e165 100644
--- a/chrome/browser/ui/views/profiles/avatar_menu_button.cc
+++ b/chrome/browser/ui/views/profiles/avatar_menu_button.cc
@@ -12,8 +12,9 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/profiles/avatar_menu.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_attributes_entry.h"
+#include "chrome/browser/profiles/profile_attributes_storage.h"
#include "chrome/browser/profiles/profile_avatar_icon_util.h"
-#include "chrome/browser/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_metrics.h"
#include "chrome/browser/ui/browser.h"
@@ -117,16 +118,15 @@ bool AvatarMenuButton::GetAvatarImages(BrowserView* browser_view,
&is_badge_rectangle);
#endif
} else if (should_show_avatar_menu) {
- ProfileInfoCache& cache =
- g_browser_process->profile_manager()->GetProfileInfoCache();
- size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath());
- if (index == std::string::npos)
+ ProfileAttributesEntry* entry;
+ if (!g_browser_process->profile_manager()->GetProfileAttributesStorage().
+ GetProfileAttributesWithPath(profile->GetPath(), &entry))
return false;
#if defined(OS_CHROMEOS)
AvatarMenu::GetImageForMenuButton(profile->GetPath(), avatar, is_rectangle);
#else
- *avatar = cache.GetAvatarIconOfProfileAtIndex(index);
+ *avatar = entry->GetAvatarIcon();
// TODO(noms): Once the code for the old avatar menu button is removed,
// this function will only be called for badging the taskbar icon. The
// function can be renamed to something like GetAvatarImageForBadging()
« no previous file with comments | « chrome/browser/ui/views/frame/global_menu_bar_x11.cc ('k') | chrome/browser/ui/views/profiles/new_avatar_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698