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

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

Issue 7061001: Mac: Make ProfileMenuButton a MenuButton. (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/menu_button.mm
diff --git a/chrome/browser/ui/cocoa/menu_button.mm b/chrome/browser/ui/cocoa/menu_button.mm
index a49dbab0a59f7867127033d6a21a58cc5fab0d52..92b4c499733bf7b75072af4ce71294f81c6d477f 100644
--- a/chrome/browser/ui/cocoa/menu_button.mm
+++ b/chrome/browser/ui/cocoa/menu_button.mm
@@ -79,6 +79,10 @@
}
}
+- (NSRect)menuRect {
+ return [self bounds];
+}
+
@end // @implementation MenuButton
@implementation MenuButton (Private)
@@ -113,8 +117,7 @@
// is flipped, and that frame should be in our coordinates.) The y/height is
// very odd, since it doesn't seem to respond to changes the way that it
// should. I don't understand it.
- NSRect frame = [self convertRect:[self frame]
sail 2011/05/23 17:51:08 This old convertRect:fromView: looks weird. Do you
Nico 2011/05/23 18:00:33 Trung sometimes does things like this, just to kee
viettrungluu 2011/05/23 18:22:12 By which Nico really means: I wasn't really a Mac
- fromView:[self superview]];
+ NSRect frame = [self menuRect];
frame.origin.x -= 2.0;
frame.size.height += 10.0;
@@ -134,10 +137,8 @@
DCHECK(popUpCell_.get());
[popUpCell_ setMenu:[self attachedMenu]];
[popUpCell_ selectItem:nil];
- [popUpCell_ attachPopUpWithFrame:frame
- inView:self];
- [popUpCell_ performClickWithFrame:frame
- inView:self];
+ [popUpCell_ attachPopUpWithFrame:frame inView:self];
+ [popUpCell_ performClickWithFrame:frame inView:self];
// Once the menu is dismissed send a mouseExited event if necessary. If the
// menu action caused the super view to resize then we won't automatically

Powered by Google App Engine
This is Rietveld 408576698