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

Issue 22867009: Swap main menu with app-specific menu when app window focused. (Closed)

Created:
7 years, 4 months ago by jackhou1
Modified:
7 years, 3 months ago
Reviewers:
Robert Sesek, tapted, Nico
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org
Visibility:
Public.

Description

Swap main menu with app-specific menu when app window focused. When an app window is focused, a new menu item is created for that app and appended to the main menu. All of Chrome's menu items are hidden. When a Chrome window is focused, the app's menu item is removed and Chrome's menu items are unhidden. This is a second attempt at https://codereview.chromium.org/18089012/ which had to be reverted because it broke keyboard shortcuts. This moves all packaged app menu item handling into a new AppShimMenuController. BUG=168080, 276052 Focus the app window, the only item in the main menu bar should be that app. Focus a browser window, the main menu bar returns to normal. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=220540

Patch Set 1 #

Total comments: 39

Patch Set 2 : Also catch NSWindowWillCloseNotification. #

Patch Set 3 : Don't recreate the menu each time. #

Total comments: 20

Patch Set 4 : Address comments #

Patch Set 5 : Factor out initialization code. #

Total comments: 3

Patch Set 6 : Use isEqualToString #

Patch Set 7 : Sync and rebase #

Patch Set 8 : Move platform_app_browsertest_util.h #

Patch Set 9 : Missed something in rebase. #

Total comments: 12

Patch Set 10 : Address comments #

Patch Set 11 : Address comment #

Total comments: 4

Patch Set 12 : Address comments #

Patch Set 13 : Sync and rebase #

Patch Set 14 : Fix gypi #

Unified diffs Side-by-side diffs Delta from patch set Stats (+304 lines, -0 lines) Patch
M chrome/browser/app_controller_mac.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/browser/app_controller_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +8 lines, -0 lines 0 comments Download
A chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +28 lines, -0 lines 0 comments Download
A chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +129 lines, -0 lines 0 comments Download
A chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac_browsertest.mm View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +132 lines, -0 lines 0 comments Download
M chrome/chrome_browser_ui.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
jackhou1
This does not yet fix keyboard shortcuts. I can either add that to this CL, ...
7 years, 4 months ago (2013-08-15 01:29:30 UTC) #1
tapted
+ chrome-apps-syd-reviews I started the review before the follow-up patchsets came in, so I think ...
7 years, 4 months ago (2013-08-15 04:39:23 UTC) #2
jackhou1
https://codereview.chromium.org/22867009/diff/1/chrome/browser/app_controller_mac.mm File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/22867009/diff/1/chrome/browser/app_controller_mac.mm#newcode320 chrome/browser/app_controller_mac.mm:320: appMenuController_.reset([[AppMenuController alloc] init]); On 2013/08/15 04:39:23, tapted wrote: > ...
7 years, 4 months ago (2013-08-16 02:50:41 UTC) #3
tapted
> https://codereview.chromium.org/22867009/diff/1/chrome/browser/ui/cocoa/apps/app_menu_controller_mac.mm#newcode59 > chrome/browser/ui/cocoa/apps/app_menu_controller_mac.mm:59: if ([notification > name] == NSWindowDidBecomeMainNotification) { > On 2013/08/15 04:39:23, ...
7 years, 4 months ago (2013-08-19 00:35:56 UTC) #4
tapted
On 2013/08/19 00:35:56, tapted wrote: > https://codereview.chromium.org/22867009/diff/23001/chrome/browser/app_controller_mac.mm#newcode56 > chrome/browser/app_controller_mac.mm:56: #import > "chrome/browser/ui/cocoa/apps/app_menu_controller_mac.h" > as you ...
7 years, 4 months ago (2013-08-19 00:43:11 UTC) #5
jackhou1
https://codereview.chromium.org/22867009/diff/1/chrome/browser/ui/cocoa/apps/app_menu_controller_mac.mm File chrome/browser/ui/cocoa/apps/app_menu_controller_mac.mm (right): https://codereview.chromium.org/22867009/diff/1/chrome/browser/ui/cocoa/apps/app_menu_controller_mac.mm#newcode54 chrome/browser/ui/cocoa/apps/app_menu_controller_mac.mm:54: apps::ShellWindowRegistry::GetShellWindowForNativeWindowAnyProfile( On 2013/08/16 02:50:41, jackhou1 wrote: > On 2013/08/15 ...
7 years, 4 months ago (2013-08-19 03:47:57 UTC) #6
benwells
On 2013/08/19 00:43:11, tapted wrote: > On 2013/08/19 00:35:56, tapted wrote: > > > https://codereview.chromium.org/22867009/diff/23001/chrome/browser/app_controller_mac.mm#newcode56 ...
7 years, 4 months ago (2013-08-19 06:15:26 UTC) #7
jackhou1
rsesek, could you please review for OWNERS of chrome/browser/ui/cocoa/
7 years, 4 months ago (2013-08-21 02:51:33 UTC) #8
Robert Sesek
This looks pretty good. I have a few questions, though; - Is this only creating ...
7 years, 4 months ago (2013-08-21 14:21:49 UTC) #9
jackhou1
> - Is this only creating a single main menu item for the app? Yup, ...
7 years, 4 months ago (2013-08-21 23:54:48 UTC) #10
tapted
https://codereview.chromium.org/22867009/diff/41001/chrome/browser/ui/cocoa/apps/app_menu_controller_mac.h File chrome/browser/ui/cocoa/apps/app_menu_controller_mac.h (right): https://codereview.chromium.org/22867009/diff/41001/chrome/browser/ui/cocoa/apps/app_menu_controller_mac.h#newcode26 chrome/browser/ui/cocoa/apps/app_menu_controller_mac.h:26: - (void)unregisterEventHandlers; On 2013/08/21 23:54:48, jackhou1 wrote: > On ...
7 years, 4 months ago (2013-08-22 00:27:01 UTC) #11
jackhou1
https://codereview.chromium.org/22867009/diff/41001/chrome/browser/ui/cocoa/apps/app_menu_controller_mac.h File chrome/browser/ui/cocoa/apps/app_menu_controller_mac.h (right): https://codereview.chromium.org/22867009/diff/41001/chrome/browser/ui/cocoa/apps/app_menu_controller_mac.h#newcode26 chrome/browser/ui/cocoa/apps/app_menu_controller_mac.h:26: - (void)unregisterEventHandlers; On 2013/08/22 00:27:02, tapted wrote: > On ...
7 years, 4 months ago (2013-08-22 01:44:02 UTC) #12
Robert Sesek
LGTM w/ nits https://codereview.chromium.org/22867009/diff/56001/chrome/browser/app_controller_mac.mm File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/22867009/diff/56001/chrome/browser/app_controller_mac.mm#newcode436 chrome/browser/app_controller_mac.mm:436: [self unregisterEventHandlers]; nit: blank line after ...
7 years, 4 months ago (2013-08-22 16:22:44 UTC) #13
jackhou1
https://codereview.chromium.org/22867009/diff/56001/chrome/browser/app_controller_mac.mm File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/22867009/diff/56001/chrome/browser/app_controller_mac.mm#newcode436 chrome/browser/app_controller_mac.mm:436: [self unregisterEventHandlers]; On 2013/08/22 16:22:45, rsesek wrote: > nit: ...
7 years, 4 months ago (2013-08-23 02:36:41 UTC) #14
jackhou1
thakis, please review for OWNERS in chrome/browser/
7 years, 4 months ago (2013-08-23 05:34:10 UTC) #15
Nico
chrome/ lgtm
7 years, 4 months ago (2013-08-23 13:39:23 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jackhou@chromium.org/22867009/70001
7 years, 3 months ago (2013-08-30 05:07:48 UTC) #17
commit-bot: I haz the power
7 years, 3 months ago (2013-08-30 09:03:23 UTC) #18
Message was sent while issue was closed.
Change committed as 220540

Powered by Google App Engine
This is Rietveld 408576698