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

Issue 7061001: Mac: Make ProfileMenuButton a MenuButton. (Closed)

Created:
9 years, 7 months ago by Nico
Modified:
9 years, 7 months ago
CC:
chromium-reviews, pam+watch_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Mac: Make ProfileMenuButton a MenuButton. Increases code reuse a bit. To make this work, give MenuButton a -menuRect function, since ProfileMenuButton is larger than the area it draws in. Also potentially addresses the problem described inhttp://waffle.wootest.net/2007/08/07/popping-up-a-menu-in-cocoa/ which might be 10.5-only. xib changes: Remove the old popup button-based PopupMenuButton, re-add it by duplicating the new tab button, changing the resize anchor to the upper-right corner, and changing the cell to ClickHoldButtonCell. BUG=83169 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=86295

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+124 lines, -210 lines) Patch
M chrome/app/nibs/BrowserWindow.xib View 17 chunks +95 lines, -95 lines 0 comments Download
M chrome/browser/ui/cocoa/menu_button.h View 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/menu_button.mm View 3 chunks +7 lines, -6 lines 3 comments Download
M chrome/browser/ui/cocoa/profile_menu_button.h View 2 chunks +2 lines, -5 lines 0 comments Download
M chrome/browser/ui/cocoa/profile_menu_button.mm View 3 chunks +14 lines, -55 lines 1 comment Download
M chrome/browser/ui/cocoa/profile_menu_button_unittest.mm View 3 chunks +2 lines, -49 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Nico
9 years, 7 months ago (2011-05-22 02:17:23 UTC) #1
Miranda Callahan
LGTM, but wait for sail or vtl to weigh in...
9 years, 7 months ago (2011-05-23 16:10:10 UTC) #2
viettrungluu
LGTM w/nit. http://codereview.chromium.org/7061001/diff/1/chrome/browser/ui/cocoa/profile_menu_button.mm File chrome/browser/ui/cocoa/profile_menu_button.mm (right): http://codereview.chromium.org/7061001/diff/1/chrome/browser/ui/cocoa/profile_menu_button.mm#newcode354 chrome/browser/ui/cocoa/profile_menu_button.mm:354: - (NSMenu *)attachedMenu { Nit: no space ...
9 years, 7 months ago (2011-05-23 16:52:19 UTC) #3
sail
LGTM. Thanks for doing this! A couple things that might need tweaking (I can do ...
9 years, 7 months ago (2011-05-23 17:51:07 UTC) #4
Nico
The menu should show up on mouse-down already, and is positioned similar to where it ...
9 years, 7 months ago (2011-05-23 18:00:33 UTC) #5
viettrungluu
9 years, 7 months ago (2011-05-23 18:22:12 UTC) #6
http://codereview.chromium.org/7061001/diff/1/chrome/browser/ui/cocoa/menu_bu...
File chrome/browser/ui/cocoa/menu_button.mm (left):

http://codereview.chromium.org/7061001/diff/1/chrome/browser/ui/cocoa/menu_bu...
chrome/browser/ui/cocoa/menu_button.mm:116: NSRect frame = [self
convertRect:[self frame]
On 2011/05/23 18:00:33, Nico wrote:
> On 2011/05/23 17:51:08, sail wrote:
> > This old convertRect:fromView: looks weird. Do you know why it was written
> like
> > that?
> 
> Trung sometimes does things like this, just to keep us on our toes.

By which Nico really means: I wasn't really a Mac programmer when I wrote this,
and didn't know about -bounds (I swear!).

Powered by Google App Engine
This is Rietveld 408576698