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

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

Issue 7327003: Multi-Profiles: Add customize profile menu item (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Multi-Profiles: Add customize profile menu item Created 9 years, 5 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/cocoa/browser/avatar_button.mm
===================================================================
--- chrome/browser/ui/cocoa/browser/avatar_button.mm (revision 91777)
+++ chrome/browser/ui/cocoa/browser/avatar_button.mm (working copy)
@@ -6,6 +6,7 @@
#include "base/sys_string_conversions.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/browser.h"
#import "chrome/browser/ui/cocoa/browser_window_controller.h"
#import "chrome/browser/ui/cocoa/image_utils.h"
#import "chrome/browser/ui/cocoa/menu_controller.h"
@@ -23,12 +24,10 @@
@implementation AvatarButton
-- (id)initWithController:(BrowserWindowController*)bwc {
+- (id)initWithBrowser:(Browser*)browser {
if ((self = [super init])) {
- // TODO(rsesek): Eventually the PMM will require a Browser so the BWC
- // is plumbed here for that reason. SAIL WILL DO THIS!!1!!1
- controller_ = bwc;
- model_.reset(new ProfileMenuModel([controller_ profile]));
+ browser_ = browser;
+ model_.reset(new ProfileMenuModel(browser_));
menuController_.reset(
[[MenuController alloc] initWithModel:model_.get()
useWithPopUpButtonCell:NO]);
@@ -48,13 +47,13 @@
[self addSubview:button_];
[self setOpenMenuOnClick:YES];
- if ([controller_ profile]->IsOffTheRecord()) {
+ if (browser_->profile()->IsOffTheRecord()) {
[self setImage:gfx::GetCachedImageWithName(@"otr_icon.pdf")];
- } else if ([controller_ shouldShowAvatar]) {
+ } else {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
[self setImage:rb.GetNativeImageNamed(IDR_PROFILE_AVATAR_1).ToNSImage()];
[button_ setToolTip:
- base::SysUTF8ToNSString([controller_ profile]->GetProfileName())];
+ base::SysUTF8ToNSString(browser_->profile()->GetProfileName())];
}
}
return self;
« no previous file with comments | « chrome/browser/ui/cocoa/browser/avatar_button.h ('k') | chrome/browser/ui/cocoa/browser_window_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698