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

Issue 3163023: Clean up the WrenchMenuModel so that it uses SimpleMenu::Delegate. (Closed)

Created:
10 years, 4 months ago by Elliot Glaysher
Modified:
9 years, 7 months ago
Reviewers:
Robert Sesek, sky
CC:
chromium-reviews, John Grabowski, pam+watch_chromium.org, ben+cc_chromium.org, Paweł Hajdan Jr.
Base URL:
http://src.chromium.org/git/chromium.git
Visibility:
Public.

Description

Clean up the WrenchMenuModel so that it uses SimpleMenu::Delegate. This removes copy-pasted code in each platform implementation. BUG=47320 TEST=compiles Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=57119

Patch Set 1 #

Patch Set 2 : Uploading for downloading #

Patch Set 3 : Fix linux+win #

Patch Set 4 : Fix up unit tests #

Patch Set 5 : 80 col #

Patch Set 6 : rebase #

Patch Set 7 : Fix mac compile issues #

Patch Set 8 : Fix stray rb #

Patch Set 9 : Fix stray rb #

Total comments: 14
Unified diffs Side-by-side diffs Delta from patch set Stats (+215 lines, -243 lines) Patch
M app/menus/accelerator.h View 1 chunk +12 lines, -0 lines 1 comment Download
M chrome/browser/cocoa/toolbar_controller.h View 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/cocoa/toolbar_controller.mm View 1 2 3 4 5 6 4 chunks +7 lines, -42 lines 1 comment Download
M chrome/browser/cocoa/wrench_menu_controller.h View 2 chunks +4 lines, -3 lines 5 comments Download
M chrome/browser/cocoa/wrench_menu_controller.mm View 2 chunks +6 lines, -31 lines 6 comments Download
M chrome/browser/cocoa/wrench_menu_controller_unittest.mm View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/gtk/browser_toolbar_gtk.h View 3 chunks +3 lines, -5 lines 0 comments Download
M chrome/browser/gtk/browser_toolbar_gtk.cc View 2 chunks +2 lines, -28 lines 0 comments Download
M chrome/browser/views/toolbar_view.h View 1 2 4 chunks +5 lines, -7 lines 0 comments Download
M chrome/browser/views/toolbar_view.cc View 1 2 4 chunks +3 lines, -21 lines 0 comments Download
M chrome/browser/wrench_menu_model.h View 1 2 3 4 5 6 chunks +14 lines, -13 lines 0 comments Download
M chrome/browser/wrench_menu_model.cc View 1 2 3 4 5 6 7 8 10 chunks +98 lines, -74 lines 1 comment Download
M chrome/browser/wrench_menu_model_unittest.cc View 3 2 chunks +54 lines, -15 lines 0 comments Download
M chrome/test/menu_model_test.h View 2 chunks +3 lines, -1 line 0 comments Download

Messages

Total messages: 8 (0 generated)
Elliot Glaysher
10 years, 4 months ago (2010-08-23 21:10:11 UTC) #1
sky
Nice, LGTM http://codereview.chromium.org/3163023/diff/20001/21001 File app/menus/accelerator.h (right): http://codereview.chromium.org/3163023/diff/20001/21001#newcode81 app/menus/accelerator.h:81: }; virtual protected destructor? http://codereview.chromium.org/3163023/diff/20001/21011 File chrome/browser/wrench_menu_model.cc ...
10 years, 4 months ago (2010-08-23 21:55:59 UTC) #2
Robert Sesek
http://codereview.chromium.org/3163023/diff/20001/21003 File chrome/browser/cocoa/toolbar_controller.mm (left): http://codereview.chromium.org/3163023/diff/20001/21003#oldcode582 chrome/browser/cocoa/toolbar_controller.mm:582: [wrenchMenuController_ insertUpdateAvailableItem]; Removing this concerns me. Does this break ...
10 years, 4 months ago (2010-08-24 00:31:13 UTC) #3
Robert Sesek
I see that this was committed without any review of the Cocoa parts. You need ...
10 years, 4 months ago (2010-08-24 00:31:47 UTC) #4
Elliot Glaysher
On 2010/08/24 00:31:47, rsesek wrote: > I see that this was committed without any review ...
10 years, 4 months ago (2010-08-24 01:11:30 UTC) #5
Robert Sesek
On 2010/08/24 01:11:30, Elliot Glaysher wrote: > On 2010/08/24 00:31:47, rsesek wrote: > > I ...
10 years, 4 months ago (2010-08-24 15:28:07 UTC) #6
Elliot Glaysher
> If we keep the built NSMenu cached, we won't hit the reparenting views bug. ...
10 years, 4 months ago (2010-08-24 22:55:09 UTC) #7
Robert Sesek
10 years, 4 months ago (2010-08-25 00:32:01 UTC) #8
On 2010/08/24 22:55:09, Elliot Glaysher wrote:
> > If we keep the built NSMenu cached, we won't hit the reparenting views bug.
> >  But
> > you'll likely need the code in |-insertUpdateAvailableItem|.  I'd keep
the
> > method impl around for now as that's likely what will need to be called when
> > you
> > check if new items need to be visible.  Since the Mac has no About menu
> > item,
> > you'll need to be inserting the update item when it needs to be there.
 Is
> > maybe
> > a better solution to give the abstract MenuModel a Delegate that broadcasts
> > insert/remove/update notifications?
> 
> I'm not sure if we have a failure to communicate here. Why would I
> have insert/remove/update notifications? Why can't I just use
> -[NSMenuItem setHidden:]?
> 
> The current weird combo about/update menu item needs to go. I'm doing
> this cleanup to make it easier to separate the update/about menu item,
> and keep that logic cross platform.

Wow I just got schooled ;-).  You're right; setting hidden makes much more sense
than the dance I described above.  I completely forgot about that.

Powered by Google App Engine
This is Rietveld 408576698