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

Issue 15955003: Menu for the OSX app launcher. (Closed)

Created:
7 years, 6 months ago by tapted
Modified:
7 years, 6 months ago
Reviewers:
Robert Sesek, Nico, sail
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org, tfarina, sail+watch_chromium.org
Visibility:
Public.

Description

Menu for the OSX app launcher, HoverImageMenuButton in src/ui/base/cocoa/controls. Adds a drop-down menu to the right of the search entry area on the OSX app launcher. The menu is shown when clicked, and the button responds to hover effects. The menu button uses a new class, HoverImageMenuButton, which is derived from an NSPopUpButton with minor extensions. Notably, it does not have a dependency on browser themes, as does MenuButton from chrome/browser/ui/cocoa. It tracks the mouse hover state and updates the cell, which extends NSPopUpButtonCell and shows only the image in the control frame -- no border, bezel, label, or dropdown arrow. HoverImageMenuButtonCell supports a hover image, which behaves much like an additional 'alternateImage' from NSButtonCell but for the hover state, rather than the 'pressed' (or 'lit') state. The menu shows the currently signed-in user, in a custom view as the first item. It also (currently) shows menu options for Settings, Help, and Feedback. BUG=138633 TEST=Added app_list_unittests AppsSearchBoxMenuTest and AppsSearchBoxMenuTest and tested manually to ensure the items are launched correctly. Added ui_unittests HoverImageMenuButtonTest.* Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=206237 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=206930

Patch Set 1 : split #

Total comments: 7

Patch Set 2 : ensure the correct font is used #

Patch Set 3 : AppListMenuCocoa -> AppListMenuButton #

Patch Set 4 : Refactor HoverImageMenuButton into /ui/base/cocoa/controls #

Total comments: 48

Patch Set 5 : respond to comments #

Patch Set 6 : rebase wrt CL-15653008 #

Patch Set 7 : rebase wrt a better CL-15653008 #

Patch Set 8 : rebase only w.r.t. master and CL-15870006 #

Patch Set 9 : fix tests, and align setHover* behaviour with setAlternateImage/setHighlighted #

Patch Set 10 : Switch to using menu controller #

Patch Set 11 : Discovered [NSFont menuFontOfSize:0] #

Patch Set 12 : rebase for final CL-15653008 #

Patch Set 13 : Apply CL to master (clean) #

Total comments: 13

Patch Set 14 : address comments #

Total comments: 6

Patch Set 15 : respond to comments #

Total comments: 3

Patch Set 16 : rebase only, for gyp conflict #

Patch Set 17 : setImage -> setDefaultImage, fixes leak #

Total comments: 2

Patch Set 18 : fix comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+651 lines, -7 lines) Patch
M build/common.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -2 lines 0 comments Download
M ui/app_list/app_list.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -0 lines 0 comments Download
M ui/app_list/app_list_menu.h View 1 chunk +0 lines, -1 line 0 comments Download
M ui/app_list/cocoa/app_list_view_controller.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M ui/app_list/cocoa/app_list_view_controller.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +4 lines, -0 lines 0 comments Download
M ui/app_list/cocoa/apps_search_box_controller.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +10 lines, -0 lines 0 comments Download
M ui/app_list/cocoa/apps_search_box_controller.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +104 lines, -3 lines 0 comments Download
M ui/app_list/cocoa/apps_search_box_controller_unittest.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +64 lines, -0 lines 0 comments Download
A ui/app_list/cocoa/current_user_menu_item_view.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +24 lines, -0 lines 0 comments Download
A ui/app_list/cocoa/current_user_menu_item_view.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +85 lines, -0 lines 0 comments Download
A ui/base/cocoa/controls/hover_image_menu_button.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +29 lines, -0 lines 0 comments Download
A ui/base/cocoa/controls/hover_image_menu_button.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +44 lines, -0 lines 0 comments Download
A ui/base/cocoa/controls/hover_image_menu_button_cell.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +35 lines, -0 lines 0 comments Download
A ui/base/cocoa/controls/hover_image_menu_button_cell.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +69 lines, -0 lines 0 comments Download
A ui/base/cocoa/controls/hover_image_menu_button_unittest.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +173 lines, -0 lines 0 comments Download
M ui/ui.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +4 lines, -0 lines 0 comments Download
M ui/ui_unittests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 40 (0 generated)
sail
https://codereview.chromium.org/15955003/diff/4001/ui/app_list/cocoa/app_list_menu_cocoa.h File ui/app_list/cocoa/app_list_menu_cocoa.h (right): https://codereview.chromium.org/15955003/diff/4001/ui/app_list/cocoa/app_list_menu_cocoa.h#newcode18 ui/app_list/cocoa/app_list_menu_cocoa.h:18: @interface AppListMenuCocoa : NSPopUpButton { How about AppListMenuButton instead? ...
7 years, 6 months ago (2013-05-31 01:20:16 UTC) #1
tapted
https://codereview.chromium.org/15955003/diff/4001/ui/app_list/cocoa/app_list_menu_cocoa.h File ui/app_list/cocoa/app_list_menu_cocoa.h (right): https://codereview.chromium.org/15955003/diff/4001/ui/app_list/cocoa/app_list_menu_cocoa.h#newcode18 ui/app_list/cocoa/app_list_menu_cocoa.h:18: @interface AppListMenuCocoa : NSPopUpButton { On 2013/05/31 01:20:16, sail ...
7 years, 6 months ago (2013-05-31 06:05:13 UTC) #2
tapted
As discussed. Patch Set 4 is a refactor of the extended NSPopUpButton to a reusable ...
7 years, 6 months ago (2013-05-31 09:37:39 UTC) #3
Robert Sesek
https://codereview.chromium.org/15955003/diff/4001/ui/app_list/cocoa/app_list_menu_cocoa.mm File ui/app_list/cocoa/app_list_menu_cocoa.mm (right): https://codereview.chromium.org/15955003/diff/4001/ui/app_list/cocoa/app_list_menu_cocoa.mm#newcode23 ui/app_list/cocoa/app_list_menu_cocoa.mm:23: @interface AppListMenuCocoaCell : NSPopUpButtonCell { On 2013/05/31 06:05:13, tapted ...
7 years, 6 months ago (2013-05-31 18:25:35 UTC) #4
sail
https://codereview.chromium.org/15955003/diff/22011/ui/app_list/cocoa/apps_search_box_controller.mm File ui/app_list/cocoa/apps_search_box_controller.mm (right): https://codereview.chromium.org/15955003/diff/22011/ui/app_list/cocoa/apps_search_box_controller.mm#newcode183 ui/app_list/cocoa/apps_search_box_controller.mm:183: [[menuButton_ cell] setImage:resourceBundle.GetNativeImageNamed( use hoverImageMenuButtonCell accessor instead? https://codereview.chromium.org/15955003/diff/22011/ui/app_list/cocoa/apps_search_box_controller.mm#newcode196 ui/app_list/cocoa/apps_search_box_controller.mm:196: ...
7 years, 6 months ago (2013-05-31 19:07:03 UTC) #5
Robert Sesek
https://codereview.chromium.org/15955003/diff/22011/ui/app_list/cocoa/apps_search_box_controller.mm File ui/app_list/cocoa/apps_search_box_controller.mm (right): https://codereview.chromium.org/15955003/diff/22011/ui/app_list/cocoa/apps_search_box_controller.mm#newcode213 ui/app_list/cocoa/apps_search_box_controller.mm:213: - (void)addItemToMenu:(NSMenu*)menu Have you considered using MenuController? https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/ui/cocoa/menu_controller.h&sq=package:chromium&type=cs It'd ...
7 years, 6 months ago (2013-05-31 19:16:09 UTC) #6
tapted
I remembered to rev up by x64 build this time, so there are also some ...
7 years, 6 months ago (2013-06-03 12:49:18 UTC) #7
tapted
https://codereview.chromium.org/15955003/diff/22011/ui/app_list/cocoa/apps_search_box_controller.mm File ui/app_list/cocoa/apps_search_box_controller.mm (right): https://codereview.chromium.org/15955003/diff/22011/ui/app_list/cocoa/apps_search_box_controller.mm#newcode213 ui/app_list/cocoa/apps_search_box_controller.mm:213: - (void)addItemToMenu:(NSMenu*)menu On 2013/05/31 19:16:09, rsesek wrote: > Have ...
7 years, 6 months ago (2013-06-03 12:54:24 UTC) #8
Robert Sesek
On 2013/06/03 12:54:24, tapted wrote: > https://codereview.chromium.org/15955003/diff/22011/ui/app_list/cocoa/apps_search_box_controller.mm > File ui/app_list/cocoa/apps_search_box_controller.mm (right): > > https://codereview.chromium.org/15955003/diff/22011/ui/app_list/cocoa/apps_search_box_controller.mm#newcode213 > ...
7 years, 6 months ago (2013-06-03 15:48:03 UTC) #9
tapted
On 2013/06/03 15:48:03, rsesek wrote: > On 2013/06/03 12:54:24, tapted wrote: > > > https://codereview.chromium.org/15955003/diff/22011/ui/app_list/cocoa/apps_search_box_controller.mm ...
7 years, 6 months ago (2013-06-04 00:27:45 UTC) #10
tapted
Patch Set 10 (v 9) is the result of switching over to a menu_controller.h in ...
7 years, 6 months ago (2013-06-05 09:00:39 UTC) #11
Robert Sesek
On 2013/05/31 18:25:35, rsesek wrote: > https://codereview.chromium.org/15955003/diff/4001/ui/app_list/cocoa/app_list_menu_cocoa.mm > File ui/app_list/cocoa/app_list_menu_cocoa.mm (right): > > https://codereview.chromium.org/15955003/diff/4001/ui/app_list/cocoa/app_list_menu_cocoa.mm#newcode23 > ...
7 years, 6 months ago (2013-06-05 21:06:33 UTC) #12
tapted
On 2013/06/05 21:06:33, rsesek wrote: > On 2013/05/31 18:25:35, rsesek wrote: > > > https://codereview.chromium.org/15955003/diff/4001/ui/app_list/cocoa/app_list_menu_cocoa.mm ...
7 years, 6 months ago (2013-06-06 08:17:13 UTC) #13
tapted
On 2013/06/05 09:00:39, tapted wrote: > Review comments always welcome, but I will need to ...
7 years, 6 months ago (2013-06-06 08:40:43 UTC) #14
sail
lgtm! https://codereview.chromium.org/15955003/diff/108001/ui/app_list/cocoa/apps_search_box_controller.mm File ui/app_list/cocoa/apps_search_box_controller.mm (right): https://codereview.chromium.org/15955003/diff/108001/ui/app_list/cocoa/apps_search_box_controller.mm#newcode385 ui/app_list/cocoa/apps_search_box_controller.mm:385: NSPoint anchorPoint = [[menuButton window] convertBaseToScreen:NSMakePoint( convertBaseToScreen is ...
7 years, 6 months ago (2013-06-11 00:55:21 UTC) #15
tapted
+thakis for OWNERS in ui (gyp changes) rsesek/thakis: Do the other changes in ui/base look ...
7 years, 6 months ago (2013-06-11 02:32:44 UTC) #16
sail
second LGTM https://codereview.chromium.org/15955003/diff/108001/ui/app_list/cocoa/apps_search_box_controller.mm File ui/app_list/cocoa/apps_search_box_controller.mm (right): https://codereview.chromium.org/15955003/diff/108001/ui/app_list/cocoa/apps_search_box_controller.mm#newcode385 ui/app_list/cocoa/apps_search_box_controller.mm:385: NSPoint anchorPoint = [[menuButton window] convertBaseToScreen:NSMakePoint( On ...
7 years, 6 months ago (2013-06-11 18:01:24 UTC) #17
Robert Sesek
LGTM. Sorry this fell off my radar. Please ping if I don't respond within 24 ...
7 years, 6 months ago (2013-06-11 18:07:46 UTC) #18
Nico
https://codereview.chromium.org/15955003/diff/121001/ui/base/cocoa/controls/hover_image_menu_button.h File ui/base/cocoa/controls/hover_image_menu_button.h (right): https://codereview.chromium.org/15955003/diff/121001/ui/base/cocoa/controls/hover_image_menu_button.h#newcode18 ui/base/cocoa/controls/hover_image_menu_button.h:18: // index 0 is ignored and client code should ...
7 years, 6 months ago (2013-06-11 18:09:33 UTC) #19
tapted
https://codereview.chromium.org/15955003/diff/121001/ui/base/cocoa/controls/hover_image_menu_button.h File ui/base/cocoa/controls/hover_image_menu_button.h (right): https://codereview.chromium.org/15955003/diff/121001/ui/base/cocoa/controls/hover_image_menu_button.h#newcode18 ui/base/cocoa/controls/hover_image_menu_button.h:18: // index 0 is ignored and client code should ...
7 years, 6 months ago (2013-06-11 23:43:34 UTC) #20
Nico
On Tue, Jun 11, 2013 at 4:43 PM, <tapted@chromium.org> wrote: > > https://codereview.chromium.**org/15955003/diff/121001/ui/** > base/cocoa/controls/hover_**image_menu_button.h<https://codereview.chromium.org/15955003/diff/121001/ui/base/cocoa/controls/hover_image_menu_button.h> ...
7 years, 6 months ago (2013-06-11 23:45:10 UTC) #21
tapted
On 2013/06/11 23:45:10, Nico wrote: > On Tue, Jun 11, 2013 at 4:43 PM, <mailto:tapted@chromium.org> ...
7 years, 6 months ago (2013-06-12 00:01:10 UTC) #22
tapted
thakis: ping? (lgty?)
7 years, 6 months ago (2013-06-12 23:49:49 UTC) #23
Nico
On 2013/06/12 23:49:49, tapted wrote: > thakis: ping? (lgty?) Yes, lgtm. Sorry, I thought I ...
7 years, 6 months ago (2013-06-12 23:52:15 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tapted@chromium.org/15955003/136001
7 years, 6 months ago (2013-06-12 23:58:11 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tapted@chromium.org/15955003/136001
7 years, 6 months ago (2013-06-13 02:32:04 UTC) #26
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 6 months ago (2013-06-13 06:47:47 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tapted@chromium.org/15955003/136001
7 years, 6 months ago (2013-06-13 09:39:56 UTC) #28
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 6 months ago (2013-06-13 09:45:01 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tapted@chromium.org/15955003/136001
7 years, 6 months ago (2013-06-13 22:15:05 UTC) #30
commit-bot: I haz the power
Change committed as 206237
7 years, 6 months ago (2013-06-14 00:12:54 UTC) #31
tapted
Ended up reverting this due some stuff valgrind picked up. My theories below. I'll see ...
7 years, 6 months ago (2013-06-14 09:27:29 UTC) #32
Robert Sesek
https://codereview.chromium.org/15955003/diff/136001/ui/base/cocoa/controls/hover_image_menu_button_cell.mm File ui/base/cocoa/controls/hover_image_menu_button_cell.mm (right): https://codereview.chromium.org/15955003/diff/136001/ui/base/cocoa/controls/hover_image_menu_button_cell.mm#newcode53 ui/base/cocoa/controls/hover_image_menu_button_cell.mm:53: - (void)setImage:(NSImage*)defaultImage { On 2013/06/14 09:27:30, tapted wrote: > ...
7 years, 6 months ago (2013-06-14 16:48:09 UTC) #33
tapted
Robert, PTAL at the update in Patchset 17. I got a local repro in 10.6 ...
7 years, 6 months ago (2013-06-17 07:58:10 UTC) #34
Robert Sesek
lgtm https://codereview.chromium.org/15955003/diff/197001/ui/base/cocoa/controls/hover_image_menu_button_cell.h File ui/base/cocoa/controls/hover_image_menu_button_cell.h (right): https://codereview.chromium.org/15955003/diff/197001/ui/base/cocoa/controls/hover_image_menu_button_cell.h#newcode14 ui/base/cocoa/controls/hover_image_menu_button_cell.h:14: // image in its frame; no border, bezel ...
7 years, 6 months ago (2013-06-17 15:46:26 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tapted@chromium.org/15955003/210001
7 years, 6 months ago (2013-06-17 23:09:28 UTC) #36
tapted
https://codereview.chromium.org/15955003/diff/197001/ui/base/cocoa/controls/hover_image_menu_button_cell.h File ui/base/cocoa/controls/hover_image_menu_button_cell.h (right): https://codereview.chromium.org/15955003/diff/197001/ui/base/cocoa/controls/hover_image_menu_button_cell.h#newcode14 ui/base/cocoa/controls/hover_image_menu_button_cell.h:14: // image in its frame; no border, bezel or ...
7 years, 6 months ago (2013-06-17 23:10:33 UTC) #37
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=164584
7 years, 6 months ago (2013-06-18 00:28:50 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tapted@chromium.org/15955003/210001
7 years, 6 months ago (2013-06-18 00:39:50 UTC) #39
commit-bot: I haz the power
7 years, 6 months ago (2013-06-18 11:09:34 UTC) #40
Message was sent while issue was closed.
Change committed as 206930

Powered by Google App Engine
This is Rietveld 408576698