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

Issue 3189003: Added support for context menus to status icons. (Closed)

Created:
10 years, 4 months ago by Andrew T Wilson (Slow)
Modified:
9 years, 7 months ago
Reviewers:
John Gregg, tfarina
CC:
chromium-reviews, ben+cc_chromium.org, John Grabowski, Erik does not do reviews, Aaron Boodman, pam+watch_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Added support for context menus to status icons. BUG=37375 TEST=updated StatusIcon unit tests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=56812

Patch Set 1 #

Patch Set 2 : Updated with gtk method stubs. #

Patch Set 3 : Working version of context menus on windows #

Total comments: 2

Patch Set 4 : Revamped API to pass MenuModel into StatusIcon #

Patch Set 5 : Compilation fixes #

Total comments: 6

Patch Set 6 : Cleaned up incorrect comment and renamed param to HandleClickEvent. #

Patch Set 7 : Final version. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+189 lines, -19 lines) Patch
M chrome/browser/background_mode_manager.h View 1 2 3 3 chunks +8 lines, -3 lines 0 comments Download
M chrome/browser/background_mode_manager.cc View 1 2 3 4 5 5 chunks +50 lines, -4 lines 0 comments Download
M chrome/browser/cocoa/status_icons/status_icon_mac.h View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/cocoa/status_icons/status_icon_mac.mm View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/gtk/status_icons/status_icon_gtk.h View 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/gtk/status_icons/status_icon_gtk.cc View 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/status_icons/status_icon.h View 1 2 3 4 5 6 2 chunks +31 lines, -4 lines 0 comments Download
M chrome/browser/status_icons/status_icon.cc View 1 2 3 4 5 6 2 chunks +18 lines, -0 lines 0 comments Download
M chrome/browser/status_icons/status_icon_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/status_icons/status_tray_unittest.cc View 1 2 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/views/status_icons/status_icon_win.h View 3 4 5 6 3 chunks +16 lines, -0 lines 0 comments Download
M chrome/browser/views/status_icons/status_icon_win.cc View 3 4 5 6 2 chunks +30 lines, -1 line 0 comments Download
M chrome/browser/views/status_icons/status_tray_win.cc View 3 4 1 chunk +8 lines, -5 lines 0 comments Download
M chrome/browser/views/status_icons/status_tray_win_unittest.cc View 1 2 3 4 5 6 4 chunks +9 lines, -2 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Andrew T Wilson (Slow)
I know you're gardening, but hopefully you'll have the cycles to look at this. If ...
10 years, 4 months ago (2010-08-19 05:59:11 UTC) #1
tfarina
http://codereview.chromium.org/3189003/diff/5001/6014 File chrome/browser/views/status_icons/status_icon_win.h (right): http://codereview.chromium.org/3189003/diff/5001/6014#newcode45 chrome/browser/views/status_icons/status_icon_win.h:45: // menus::SimpleMenuModel::Delegate Rather than adding this code here, could ...
10 years, 4 months ago (2010-08-19 12:56:51 UTC) #2
John Gregg
Biggest concern I have is that you seem to be reinventing the wheel for menus ...
10 years, 4 months ago (2010-08-19 16:36:29 UTC) #3
Andrew T Wilson (Slow)
OK, ready for another look. On 2010/08/19 16:36:29, John Gregg wrote: > Wouldn't it be ...
10 years, 4 months ago (2010-08-19 21:26:21 UTC) #4
John Gregg
http://codereview.chromium.org/3189003/diff/1038/15001 File chrome/browser/background_mode_manager.cc (right): http://codereview.chromium.org/3189003/diff/1038/15001#newcode191 chrome/browser/background_mode_manager.cc:191: // items, be sure to update the associated kExitContextMenuItem, ...
10 years, 4 months ago (2010-08-19 21:41:30 UTC) #5
Andrew T Wilson (Slow)
OK, addressed your comments. Please take another look. http://codereview.chromium.org/3189003/diff/1038/15001 File chrome/browser/background_mode_manager.cc (right): http://codereview.chromium.org/3189003/diff/1038/15001#newcode191 chrome/browser/background_mode_manager.cc:191: // ...
10 years, 4 months ago (2010-08-19 23:53:57 UTC) #6
John Gregg
10 years, 4 months ago (2010-08-20 00:10:00 UTC) #7
One more thing I noticed: it might be nice to have the scoped_ptr<MenuModel>
live in the cross-platform part of StatusIcon, so you don't have to duplicate
that in each subclass.  You could use a protected virtual method to delegate the
platform-specific behavior when the menu is changed. 

The current effect that I was noticing is that if the BackgroundModeManager code
runs on Mac or Linux with those stub functions, the menu pointer will leak.

If you don't want to do that (or don't want to do it now), I would at least put
NOTREACHED() in those stub functions so you don't end up with surprise leaks
later.

With either of those changes this LGTM.

Powered by Google App Engine
This is Rietveld 408576698