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

Issue 92062: Clean up cocoa popup menu handling for test_shell (Closed)

Created:
11 years, 8 months ago by Paul Godavari
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Clean up cocoa popup menu handling in test_shell. The cocoa menu delegate, previously local to test_shell on Mac, now has the added responsibility of running the popup menu and processing the menu's actions. It is moved into its own files in order to use this class as-is in Chrome. BUG=8389 (http://crbug.com/8389) Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=14452

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Total comments: 1

Patch Set 7 : '' #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+217 lines, -117 lines) Patch
A webkit/glue/webmenurunner_mac.h View 1 1 chunk +71 lines, -0 lines 5 comments Download
A webkit/glue/webmenurunner_mac.mm View 1 2 3 4 5 6 1 chunk +130 lines, -0 lines 2 comments Download
M webkit/tools/test_shell/mac/test_webview_delegate.mm View 1 2 3 4 5 6 2 chunks +14 lines, -117 lines 1 comment Download
M webkit/webkit.gyp View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Paul Godavari
11 years, 8 months ago (2009-04-23 20:00:39 UTC) #1
Paul Godavari
[Note: please extra nit-pickity wrt Cocoa coding style]
11 years, 8 months ago (2009-04-23 21:55:42 UTC) #2
Amanda Walker
LGTM, though you might want to run it past tvl for a cocoa style pass. ...
11 years, 8 months ago (2009-04-24 14:18:31 UTC) #3
pink (ping after 24hrs)
11 years, 8 months ago (2009-04-27 14:14:59 UTC) #4
Nothing major, just a bunch of style stuff.

http://codereview.chromium.org/92062/diff/22/1024
File webkit/glue/webmenurunner_mac.h (right):

http://codereview.chromium.org/92062/diff/22/1024#newcode24
Line 24: NSMenu* menu_;
if owned, you should probably use a scoped_nsobject<NSMenu>

http://codereview.chromium.org/92062/diff/22/1024#newcode36
Line 36: - (void)dealloc;
no need to declare methods that are simply overridden.

http://codereview.chromium.org/92062/diff/22/1024#newcode39
Line 39: - (void)addItem:(const WebMenuItem&)item;
if it's internal, don't make it part of the public API.

http://codereview.chromium.org/92062/diff/22/1024#newcode48
Line 48: - (void)menuItemSelected:(id)sender;
again, this sounds like an implementation-specific detail. Omit from the public
api.

http://codereview.chromium.org/92062/diff/22/1024#newcode67
Line 67: NSEvent* CreateEventForMenuAction(BOOL item_chosen, int window_num,
should this go into any particular namespace? Also, is this something that's
supposed to be called by someone using this class, or is it internal?

http://codereview.chromium.org/92062/diff/22/1023
File webkit/glue/webmenurunner_mac.mm (right):

http://codereview.chromium.org/92062/diff/22/1023#newcode15
Line 15: menuItemWasChosen_ = NO;
not necessary, the runtime zero's for you.

http://codereview.chromium.org/92062/diff/22/1023#newcode35
Line 35: NSMenuItem* menu_item = [menu_ addItemWithTitle:title
in obj-c @implementation, use obj-c naming. This should be |menuItem|.

http://codereview.chromium.org/92062/diff/22/1025
File webkit/tools/test_shell/mac/test_webview_delegate.mm (right):

http://codereview.chromium.org/92062/diff/22/1025#newcode82
Line 82: WebMenuRunner* menu_runner =
can you use a scoped_nsobject here?

Powered by Google App Engine
This is Rietveld 408576698