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

Issue 1186803003: Mac: Give packaged app windows their own window cycle list. (Closed)

Created:
5 years, 6 months ago by tapted
Modified:
5 years, 6 months ago
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Mac: Give packaged app windows their own window cycle list. For now it's behind chrome://flags#app-window-cycling. This is to hopefully give a better UX for App Shims. It also solves a tricky problem with Chrome Remote Desktop: Since CRD swallows Cmd+`, it breaks browser window cycling since the cycling will stop as soon as a CRD window is encountered. This works by hooking in to the same mechanism that changes the menu bar. Switching to or away from a packaged app window will now also update the window cycle list. The CL intentionally does *not*: - try to distinguish between the same app running in different profiles, - update the `Window` menu, nor - try to do anything for Cmd+Tab switching. The hard part: AppKit does not immediately apply changes to NSWindowCollectionBehaviorIgnoresCycle after a window is already shown. An effective workaround seems to be call to [[NSApp keyWindow] makeKeyAndOrderFront:nil]. However, this may have other consequences. Lots of other things were tried (see code comments). Adds an interactive UI test. Tests on mac using ui_test_utils::ShowAndFocusNativeWindow(..) have a history of flakiness, so this CL attempts to address that by combining with a notification observer. This approach has successfully addressed flakiness around key-window transitions elsewhere. It would commonly occur when multiple windows are in the process -- a single RunLoop().RunUntilIdle() couldn't guarantee that the window server had completed the switch. BUG=484737, 278408 Committed: https://crrev.com/91f299c14448905eaeaf635c86d3d527241d02e7 Cr-Commit-Position: refs/heads/master@{#336063}

Patch Set 1 #

Patch Set 2 : Implemented. But Flaky. No idea why. #

Patch Set 3 : Tracing. Yep: seems AppKit happily includes NSWindowCollectionBehaviorIgnoresCycle in _getLockedWin… #

Patch Set 4 : Something that works! But.. it is a bit scary still #

Patch Set 5 : Add command line flag #

Patch Set 6 : WIP #

Patch Set 7 : A test! #

Patch Set 8 : nits #

Patch Set 9 : Now testing without the private API #

Total comments: 2

Patch Set 10 : rebase (conflicts with r335465) #

Patch Set 11 : Support jumps #

Total comments: 2

Patch Set 12 : extension || is_browser + cl format #

Total comments: 4

Patch Set 13 : rebase #

Patch Set 14 : rsesek comments #

Patch Set 15 : rebase (overlap with r335812 and I want a fresh CQ run) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+369 lines, -55 lines) Patch
M chrome/app/generated_resources.grd View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/about_flags.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.h View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 12 chunks +159 lines, -32 lines 0 comments Download
A chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac_interactive_uitest.mm View 1 2 3 4 5 6 7 8 1 chunk +134 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 14 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/chrome_switches.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/common/chrome_switches.cc View 1 2 3 4 5 6 7 8 9 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/test/base/interactive_test_utils_mac.mm View 1 2 3 4 5 2 chunks +11 lines, -2 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -0 lines 0 comments Download
M ui/base/test/windowed_nsnotification_observer.h View 1 2 3 4 5 6 7 8 9 13 14 2 chunks +12 lines, -8 lines 0 comments Download
M ui/base/test/windowed_nsnotification_observer.mm View 1 2 3 4 5 6 7 8 9 10 13 14 2 chunks +28 lines, -12 lines 0 comments Download

Messages

Total messages: 24 (10 generated)
tapted
Hi Jack - please take a look
5 years, 6 months ago (2015-06-22 00:00:20 UTC) #5
jackhou1
lgtm https://codereview.chromium.org/1186803003/diff/220001/ui/base/test/windowed_nsnotification_observer.h File ui/base/test/windowed_nsnotification_observer.h (right): https://codereview.chromium.org/1186803003/diff/220001/ui/base/test/windowed_nsnotification_observer.h#newcode36 ui/base/test/windowed_nsnotification_observer.h:36: // Waits for |minimumCount| notifications to be observed ...
5 years, 6 months ago (2015-06-22 01:34:26 UTC) #6
tapted
PTAL https://codereview.chromium.org/1186803003/diff/220001/ui/base/test/windowed_nsnotification_observer.h File ui/base/test/windowed_nsnotification_observer.h (right): https://codereview.chromium.org/1186803003/diff/220001/ui/base/test/windowed_nsnotification_observer.h#newcode36 ui/base/test/windowed_nsnotification_observer.h:36: // Waits for |minimumCount| notifications to be observed ...
5 years, 6 months ago (2015-06-22 01:57:08 UTC) #7
jackhou1
lgtm
5 years, 6 months ago (2015-06-22 02:48:39 UTC) #8
tapted
+nico for chrome/test/base/interactive_test_utils_mac.mm +asvitkine for histograms (As well as for any sage Mac wisdom about ...
5 years, 6 months ago (2015-06-22 02:59:47 UTC) #10
Nico
I probably won't be around for the next 24h and maybe longer (dealing with s ...
5 years, 6 months ago (2015-06-22 05:55:17 UTC) #11
Alexei Svitkine (slow)
histograms lgtm +rsesek for the tricky Mac bits https://codereview.chromium.org/1186803003/diff/260001/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm File chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm (right): https://codereview.chromium.org/1186803003/diff/260001/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm#newcode226 chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm:226: any_change ...
5 years, 6 months ago (2015-06-22 15:19:55 UTC) #13
tapted
Thanks! I'll see what Robert thinks before looking for a chrome/test owner https://codereview.chromium.org/1186803003/diff/260001/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm File chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm ...
5 years, 6 months ago (2015-06-23 00:22:07 UTC) #14
Robert Sesek
LGTM https://codereview.chromium.org/1186803003/diff/280001/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm File chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm (right): https://codereview.chromium.org/1186803003/diff/280001/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm#newcode189 chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm:189: any_change = SetWindowParticipatesInCycle(window, true) || any_change; You could ...
5 years, 6 months ago (2015-06-23 15:00:55 UTC) #15
tapted
Nico: if you're back (and since you're here already..), are you able to provide OWNERS ...
5 years, 6 months ago (2015-06-23 23:36:10 UTC) #18
Nico
interactive_test_utils_mac.mm lgtm
5 years, 6 months ago (2015-06-24 19:53:20 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1186803003/380001
5 years, 6 months ago (2015-06-25 00:13:57 UTC) #22
commit-bot: I haz the power
Committed patchset #15 (id:380001)
5 years, 6 months ago (2015-06-25 01:28:25 UTC) #23
commit-bot: I haz the power
5 years, 6 months ago (2015-06-25 01:29:27 UTC) #24
Message was sent while issue was closed.
Patchset 15 (id:??) landed as
https://crrev.com/91f299c14448905eaeaf635c86d3d527241d02e7
Cr-Commit-Position: refs/heads/master@{#336063}

Powered by Google App Engine
This is Rietveld 408576698