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

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

Issue 7054031: Mac: Use cross-platform menu model for profile button. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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/profile_menu_button.mm
diff --git a/chrome/browser/ui/cocoa/profile_menu_button.mm b/chrome/browser/ui/cocoa/profile_menu_button.mm
index 866bb40ffd0275df35930abc823874ea9c2e9701..aeb1bd9f556e724305b5a8342ab34ebfe2b2949b 100644
--- a/chrome/browser/ui/cocoa/profile_menu_button.mm
+++ b/chrome/browser/ui/cocoa/profile_menu_button.mm
@@ -7,6 +7,7 @@
#include <algorithm>
#include "base/logging.h"
+#include "chrome/browser/ui/profile_menu_model.h"
#import "third_party/GTM/AppKit/GTMFadeTruncatingTextFieldCell.h"
namespace {
@@ -52,6 +53,10 @@ NSColor* GetBlackWithAlpha(CGFloat alpha) {
[textFieldCell_ setAlignment:NSRightTextAlignment];
[textFieldCell_ setFont:[NSFont systemFontOfSize:
[NSFont smallSystemFontSize]]];
+
+ profile_menu_model_.reset(new ProfileMenuModel);
+ menu_.reset([[MenuController alloc] initWithModel:profile_menu_model_.get()
+ useWithPopUpButtonCell:NO]);
}
- (id)initWithFrame:(NSRect)frame
@@ -326,6 +331,10 @@ NSColor* GetBlackWithAlpha(CGFloat alpha) {
}
}
+- (NSMenu *)menu {
+ return [menu_.get() menu];
+}
+
- (NSPoint)popUpMenuPosition {
NSPoint menuPos = [self tabRect].origin;
// By default popUpContextMenu: causes the menu to show up a few pixels above

Powered by Google App Engine
This is Rietveld 408576698