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

Issue 27058004: Use WindowActivated message instead of VisibilityChanged message to determine that Ash is the activ… (Closed)

Created:
7 years, 2 months ago by gab
Modified:
7 years, 2 months ago
CC:
chromium-reviews, kalyank, sadrul, ben+watch_chromium.org
Visibility:
Public.

Description

Use WindowActivated message instead of VisibilityChanged message to determine that Ash is the active desktop on Win8. This is better than the VisibilityChanged event as it also handles the dual monitor case where Ash isn't hidden yet is no longer active (and Chrome desktop window can thus steal the "active desktop" state which was then not given back to the Ash desktop when re-focusing it. The WindowActivated event gets a CoreWindowActivationState_PointerActivated state for this specific case; which we treat the same as CoreWindowActivationState_CodeActivated for now. Also remove the hooks for VisibilityChanged as they were only used for this purpose, i.e.: https://code.google.com/p/chromium/codesearch#search/&q=OnRootWindowActivated&sq=package:chromium&type=cs Called from: https://code.google.com/p/chromium/codesearch#chromium/src/ui/aura/env.cc&l=83 Called from: https://code.google.com/p/chromium/codesearch#chromium/src/ui/aura/root_window.cc&l=988 Called from: https://code.google.com/p/chromium/codesearch#chromium/src/ui/aura/remote_root_window_host_win.cc&l=463 BUG=177489 TEST= The most reliable test I could find that would repro this is to: 1) Open Ash 2) Open Chrome on desktop on a 2nd monitor 3) Refocus Ash on first monitor 4) Signin with an account which will sync extensions (at least one of which opens a tab on install, e.g., https://chrome.google.com/webstore/detail/reload-all-tabs/midkcinmplflbiflboepnahkboeonkam). Without this CL, this will result in the extension's tab opening on the desktop Chrome's window. With this CL, the tab correctly opens in Ash as it was the last desktop focused. Also make sure the regular use cases still work using the same test under: A) Only Ash open B) Ash open, but active desktop is native desktop. Also confirmed using Sawbuck and some logging that the following is how OnWindowActivated() reports its state: CoreWindowActivationState_CodeActivated == 0 - First activation - Activated when hidden (either from Start Screen or Windows app switcher while viewing another app). CoreWindowActivationState_Deactivated == 1 - All deactivations (including focusing a desktop app on the 2nd monitor while Ash remains open on 1st monitor) CoreWindowActivationState_PointerActivated - Ash is focused again after a window on another monitor had been focused while Ash stayed visible on its monitor. R=cdn@chromium.org, grt@chromium.org, sky@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=229420

Patch Set 1 #

Total comments: 1

Patch Set 2 : s/screen/monitor #

Total comments: 4

Patch Set 3 : +comment #

Total comments: 4

Patch Set 4 : remove dead code #

Patch Set 5 : merge up to r229418 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -34 lines) Patch
M ui/aura/remote_root_window_host_win.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M ui/aura/remote_root_window_host_win.cc View 1 2 3 4 2 chunks +4 lines, -5 lines 0 comments Download
M ui/metro_viewer/metro_viewer_messages.h View 1 chunk +2 lines, -3 lines 0 comments Download
M win8/metro_driver/chrome_app_view_ash.h View 1 2 3 2 chunks +0 lines, -4 lines 0 comments Download
M win8/metro_driver/chrome_app_view_ash.cc View 1 2 3 4 4 chunks +8 lines, -21 lines 0 comments Download

Messages

Total messages: 27 (0 generated)
gab
Carlos/Greg PTAL. Thanks! Gab https://codereview.chromium.org/27058004/diff/1/win8/metro_driver/chrome_app_view_ash.cc File win8/metro_driver/chrome_app_view_ash.cc (right): https://codereview.chromium.org/27058004/diff/1/win8/metro_driver/chrome_app_view_ash.cc#newcode880 win8/metro_driver/chrome_app_view_ash.cc:880: HRESULT ChromeAppViewAsh::OnVisibilityChanged( I decided to ...
7 years, 2 months ago (2013-10-11 21:21:13 UTC) #1
cpu_(ooo_6.6-7.5)
https://codereview.chromium.org/27058004/diff/5001/win8/metro_driver/chrome_app_view_ash.cc File win8/metro_driver/chrome_app_view_ash.cc (left): https://codereview.chromium.org/27058004/diff/5001/win8/metro_driver/chrome_app_view_ash.cc#oldcode888 win8/metro_driver/chrome_app_view_ash.cc:888: ui_channel_->Send(new MetroViewerHostMsg_VisibilityChanged(!!visible)); Lets put some text on ChromeAppViewAsh::OnVisibilityChanged stating ...
7 years, 2 months ago (2013-10-11 22:05:42 UTC) #2
cpu_(ooo_6.6-7.5)
adding sky.
7 years, 2 months ago (2013-10-11 22:06:42 UTC) #3
gab
https://codereview.chromium.org/27058004/diff/5001/win8/metro_driver/chrome_app_view_ash.cc File win8/metro_driver/chrome_app_view_ash.cc (left): https://codereview.chromium.org/27058004/diff/5001/win8/metro_driver/chrome_app_view_ash.cc#oldcode888 win8/metro_driver/chrome_app_view_ash.cc:888: ui_channel_->Send(new MetroViewerHostMsg_VisibilityChanged(!!visible)); On 2013/10/11 22:05:42, cpu wrote: > Lets ...
7 years, 2 months ago (2013-10-11 22:16:30 UTC) #4
sky
LGTM
7 years, 2 months ago (2013-10-11 22:21:53 UTC) #5
gab
On 2013/10/11 22:21:53, sky wrote: > LGTM Thanks, grt/cpu?
7 years, 2 months ago (2013-10-15 03:12:44 UTC) #6
grt (UTC plus 2)
looks good. please delete some more code while you're at it. :-) https://codereview.chromium.org/27058004/diff/16001/win8/metro_driver/chrome_app_view_ash.cc File win8/metro_driver/chrome_app_view_ash.cc ...
7 years, 2 months ago (2013-10-15 17:23:26 UTC) #7
gab
https://codereview.chromium.org/27058004/diff/16001/win8/metro_driver/chrome_app_view_ash.cc File win8/metro_driver/chrome_app_view_ash.cc (right): https://codereview.chromium.org/27058004/diff/16001/win8/metro_driver/chrome_app_view_ash.cc#newcode880 win8/metro_driver/chrome_app_view_ash.cc:880: HRESULT ChromeAppViewAsh::OnVisibilityChanged( On 2013/10/15 17:23:26, grt wrote: > is ...
7 years, 2 months ago (2013-10-15 17:53:25 UTC) #8
grt (UTC plus 2)
https://codereview.chromium.org/27058004/diff/16001/win8/metro_driver/chrome_app_view_ash.cc File win8/metro_driver/chrome_app_view_ash.cc (right): https://codereview.chromium.org/27058004/diff/16001/win8/metro_driver/chrome_app_view_ash.cc#newcode880 win8/metro_driver/chrome_app_view_ash.cc:880: HRESULT ChromeAppViewAsh::OnVisibilityChanged( On 2013/10/15 17:53:26, gab wrote: > On ...
7 years, 2 months ago (2013-10-15 19:13:19 UTC) #9
gab
https://codereview.chromium.org/27058004/diff/16001/win8/metro_driver/chrome_app_view_ash.cc File win8/metro_driver/chrome_app_view_ash.cc (right): https://codereview.chromium.org/27058004/diff/16001/win8/metro_driver/chrome_app_view_ash.cc#newcode880 win8/metro_driver/chrome_app_view_ash.cc:880: HRESULT ChromeAppViewAsh::OnVisibilityChanged( On 2013/10/15 19:13:19, grt wrote: > On ...
7 years, 2 months ago (2013-10-15 19:18:40 UTC) #10
grt (UTC plus 2)
lgtm
7 years, 2 months ago (2013-10-16 13:25:25 UTC) #11
gab
On 2013/10/16 13:25:25, grt wrote: > lgtm Thanks, Carlos I assume it's good with you ...
7 years, 2 months ago (2013-10-16 13:36:02 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gab@chromium.org/27058004/28001
7 years, 2 months ago (2013-10-16 13:36:29 UTC) #13
commit-bot: I haz the power
Retried try job too often on chromium_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=chromium_presubmit&number=30450
7 years, 2 months ago (2013-10-16 13:48:11 UTC) #14
gab
TBR: cdn for side-effect on ui/metro_viewer/metro_viewer_messages.h
7 years, 2 months ago (2013-10-16 14:57:27 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gab@chromium.org/27058004/28001
7 years, 2 months ago (2013-10-16 14:58:42 UTC) #16
Cris Neckar
IPC changes LGTM I realize this is a trivial change but please don't TBR IPC ...
7 years, 2 months ago (2013-10-16 20:45:04 UTC) #17
gab
On 2013/10/16 20:45:04, Cris Neckar wrote: > IPC changes LGTM > > I realize this ...
7 years, 2 months ago (2013-10-16 20:46:27 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gab@chromium.org/27058004/28001
7 years, 2 months ago (2013-10-16 20:47:44 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gab@chromium.org/27058004/28001
7 years, 2 months ago (2013-10-16 21:46:09 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gab@chromium.org/27058004/28001
7 years, 2 months ago (2013-10-17 02:31:23 UTC) #21
commit-bot: I haz the power
Retried try job too often on linux_chromeos for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_chromeos&number=165264
7 years, 2 months ago (2013-10-17 06:31:26 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gab@chromium.org/27058004/28001
7 years, 2 months ago (2013-10-17 19:37:19 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gab@chromium.org/27058004/28001
7 years, 2 months ago (2013-10-18 01:33:01 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gab@chromium.org/27058004/28001
7 years, 2 months ago (2013-10-18 02:15:41 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gab@chromium.org/27058004/150001
7 years, 2 months ago (2013-10-18 15:07:50 UTC) #26
gab
7 years, 2 months ago (2013-10-18 15:08:20 UTC) #27
Message was sent while issue was closed.
Committed patchset #5 manually as r229420 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698