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

Unified Diff: chrome/browser/ui/cocoa/browser/avatar_button_controller.mm

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
Index: chrome/browser/ui/cocoa/browser/avatar_button_controller.mm
diff --git a/chrome/browser/ui/cocoa/browser/avatar_button_controller.mm b/chrome/browser/ui/cocoa/browser/avatar_button_controller.mm
index 3537ad9af71fec8e16c557ccf39d1546369a06f9..9c48299ea61e9c90285420fec72fe0246789c841 100644
--- a/chrome/browser/ui/cocoa/browser/avatar_button_controller.mm
+++ b/chrome/browser/ui/cocoa/browser/avatar_button_controller.mm
@@ -234,16 +234,14 @@ const CGFloat kMenuYOffsetAdjust = 1.0;
- (void)updateAvatar {
ProfileInfoCache& cache =
g_browser_process->profile_manager()->GetProfileInfoCache();
- size_t index =
- cache.GetIndexOfProfileWithPath(browser_->profile()->GetPath());
- if (index != std::string::npos) {
- [self setImage:cache.GetAvatarIconOfProfileAtIndex(index).ToNSImage()];
-
- const string16& name = cache.GetNameOfProfileAtIndex(index);
- NSString* nsName = base::SysUTF16ToNSString(name);
- [self.view setToolTip:nsName];
+ ProfileInfoEntry entry;
+ if (cache.GetInfoForProfile(browser_->profile()->GetPath(), &entry)) {
+ [self setImage:entry.GetIcon().ToNSImage()];
+
+ NSString* name = base::SysUTF16ToNSString(entry.name());
+ [self.view setToolTip:name];
[[self.buttonView cell]
- accessibilitySetOverrideValue:nsName
+ accessibilitySetOverrideValue:name
forAttribute:NSAccessibilityValueAttribute];
}
}
« no previous file with comments | « chrome/browser/task_manager/task_manager_resource_providers.cc ('k') | chrome/browser/ui/cocoa/browser_window_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698