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

Issue 8894018: Move the concept of Activation to the Shell. (Closed)

Created:
9 years ago by Ben Goodger (Google)
Modified:
9 years ago
Reviewers:
sky
CC:
chromium-reviews, dhollowa+watch_chromium.org, Paweł Hajdan Jr., sadrul, tfarina, ben+watch_chromium.org
Visibility:
Public.

Description

Move the concept of Activation to the Shell. The Active Window is now stored in a property on the RootWindow. Classes wishing to observe changes to this can implement WindowObserver and attach to the RootWindow to be notified of changes in this property. We provide an ActivationClient interface in Aura for customers to use to set/get the active window, and deactivate a window. This is because setting the active window involves more than just changing the property, there is some additional book-keeping that must be done. The ActivationClient is stored in a property on the RootWindow. We also provide an ActivationDelegate interface in Aura that window owners can use to be notified of changes in activation state, and to specify whether or not a window can be activated. The ActivationDelegate should be stored on the relevant window in a property. I moved a lot of Activation-related functionality out of Aura, including all of the unit tests, now on ActivationController, and the associated WindowDelegate implementations which have now become a single TestActivationDelegate implementation. BUG=none TEST=unit tests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=114095 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=114121

Patch Set 1 : '' #

Total comments: 9

Patch Set 2 : '' #

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1277 lines, -680 lines) Patch
M chrome/browser/automation/testing_automation_provider_aura.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/platform_util_aura.cc View 1 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/aura/chrome_shell_delegate.cc View 1 2 chunks +2 lines, -1 line 0 comments Download
M chrome/test/base/browser_with_test_window_test.h View 1 2 2 chunks +16 lines, -0 lines 0 comments Download
M chrome/test/base/browser_with_test_window_test.cc View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura.h View 1 3 chunks +8 lines, -4 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura.cc View 1 2 3 chunks +14 lines, -10 lines 0 comments Download
M ui/aura/aura.gyp View 1 2 2 chunks +6 lines, -0 lines 0 comments Download
A ui/aura/client/activation_client.h View 1 2 1 chunk +42 lines, -0 lines 0 comments Download
A ui/aura/client/activation_client.cc View 1 1 chunk +23 lines, -0 lines 0 comments Download
A ui/aura/client/activation_delegate.h View 1 1 chunk +43 lines, -0 lines 0 comments Download
A ui/aura/client/activation_delegate.cc View 1 1 chunk +24 lines, -0 lines 0 comments Download
M ui/aura/client/aura_constants.h View 1 2 chunks +34 lines, -18 lines 0 comments Download
M ui/aura/client/aura_constants.cc View 1 1 chunk +10 lines, -5 lines 0 comments Download
M ui/aura/client/stacking_client.h View 1 1 chunk +0 lines, -8 lines 0 comments Download
M ui/aura/demo/demo_main.cc View 1 1 chunk +0 lines, -3 lines 0 comments Download
M ui/aura/root_window.h View 1 5 chunks +2 lines, -23 lines 0 comments Download
M ui/aura/root_window.cc View 1 2 7 chunks +18 lines, -78 lines 0 comments Download
M ui/aura/root_window_observer.h View 1 1 chunk +2 lines, -3 lines 0 comments Download
A ui/aura/test/test_activation_client.h View 1 2 1 chunk +44 lines, -0 lines 0 comments Download
A ui/aura/test/test_activation_client.cc View 1 2 1 chunk +59 lines, -0 lines 0 comments Download
M ui/aura/test/test_stacking_client.h View 1 1 chunk +0 lines, -2 lines 0 comments Download
M ui/aura/test/test_stacking_client.cc View 1 1 chunk +0 lines, -15 lines 0 comments Download
M ui/aura/test/test_window_delegate.h View 1 2 chunks +0 lines, -30 lines 0 comments Download
M ui/aura/test/test_window_delegate.cc View 1 2 chunks +0 lines, -38 lines 0 comments Download
M ui/aura/window.h View 1 3 chunks +2 lines, -12 lines 0 comments Download
M ui/aura/window.cc View 1 3 chunks +0 lines, -21 lines 0 comments Download
M ui/aura/window_delegate.h View 1 1 chunk +0 lines, -12 lines 0 comments Download
M ui/aura/window_unittest.cc View 1 3 chunks +0 lines, -146 lines 0 comments Download
A ui/aura_shell/activation_controller.h View 1 2 1 chunk +74 lines, -0 lines 0 comments Download
A ui/aura_shell/activation_controller.cc View 1 2 1 chunk +185 lines, -0 lines 0 comments Download
A ui/aura_shell/activation_controller_unittest.cc View 1 2 1 chunk +281 lines, -0 lines 0 comments Download
M ui/aura_shell/aura_shell.gyp View 1 3 chunks +5 lines, -1 line 0 comments Download
M ui/aura_shell/default_container_event_filter.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M ui/aura_shell/default_container_layout_manager.cc View 1 2 chunks +2 lines, -1 line 0 comments Download
M ui/aura_shell/examples/aura_shell_main.cc View 1 2 chunks +2 lines, -1 line 0 comments Download
M ui/aura_shell/modal_container_layout_manager.cc View 1 4 chunks +3 lines, -5 lines 0 comments Download
M ui/aura_shell/modal_container_layout_manager_unittest.cc View 1 6 chunks +12 lines, -11 lines 0 comments Download
M ui/aura_shell/root_window_event_filter.h View 1 1 chunk +1 line, -4 lines 0 comments Download
M ui/aura_shell/root_window_event_filter.cc View 1 2 3 chunks +4 lines, -14 lines 0 comments Download
M ui/aura_shell/root_window_event_filter_unittest.cc View 1 11 chunks +73 lines, -48 lines 0 comments Download
M ui/aura_shell/shadow_controller.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M ui/aura_shell/shell.h View 1 2 chunks +2 lines, -0 lines 0 comments Download
M ui/aura_shell/shell.cc View 1 2 chunks +3 lines, -0 lines 0 comments Download
M ui/aura_shell/stacking_controller.h View 1 1 chunk +0 lines, -7 lines 0 comments Download
M ui/aura_shell/stacking_controller.cc View 1 3 chunks +0 lines, -43 lines 0 comments Download
M ui/aura_shell/stacking_controller_unittest.cc View 1 1 chunk +0 lines, -59 lines 0 comments Download
A ui/aura_shell/test/test_activation_delegate.h View 1 chunk +59 lines, -0 lines 0 comments Download
A ui/aura_shell/test/test_activation_delegate.cc View 1 1 chunk +53 lines, -0 lines 0 comments Download
M ui/aura_shell/window_util.h View 1 2 1 chunk +13 lines, -0 lines 0 comments Download
M ui/aura_shell/window_util.cc View 1 2 2 chunks +24 lines, -1 line 0 comments Download
M ui/aura_shell/workspace/workspace.cc View 1 2 chunks +2 lines, -1 line 0 comments Download
M ui/aura_shell/workspace/workspace_manager_unittest.cc View 1 3 chunks +14 lines, -1 line 0 comments Download
M ui/aura_shell/workspace_controller.h View 1 3 chunks +8 lines, -2 lines 0 comments Download
M ui/aura_shell/workspace_controller.cc View 1 4 chunks +16 lines, -5 lines 0 comments Download
M ui/aura_shell/workspace_controller_unittest.cc View 1 6 chunks +15 lines, -3 lines 0 comments Download
M ui/views/test/views_test_base.h View 1 2 2 chunks +9 lines, -0 lines 0 comments Download
M ui/views/test/views_test_base.cc View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M ui/views/widget/native_widget_aura.h View 1 5 chunks +9 lines, -5 lines 0 comments Download
M ui/views/widget/native_widget_aura.cc View 1 9 chunks +45 lines, -32 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Ben Goodger (Google)
9 years ago (2011-12-09 22:30:54 UTC) #1
sky
http://codereview.chromium.org/8894018/diff/5015/content/browser/renderer_host/render_widget_host_view_aura.cc File content/browser/renderer_host/render_widget_host_view_aura.cc (right): http://codereview.chromium.org/8894018/diff/5015/content/browser/renderer_host/render_widget_host_view_aura.cc#newcode103 content/browser/renderer_host/render_widget_host_view_aura.cc:103: window_->SetProperty(aura::kActivationDelegateKey, It would be nice if you added a ...
9 years ago (2011-12-09 23:11:22 UTC) #2
Ben Goodger (Google)
All comments done except for question below: http://codereview.chromium.org/8894018/diff/5015/ui/aura_shell/activation_controller.cc File ui/aura_shell/activation_controller.cc (right): http://codereview.chromium.org/8894018/diff/5015/ui/aura_shell/activation_controller.cc#newcode101 ui/aura_shell/activation_controller.cc:101: if (!CanActivateWindow(window)) ...
9 years ago (2011-12-12 18:01:13 UTC) #3
sky
9 years ago (2011-12-12 18:06:11 UTC) #4
LGTM since the issue I raised has likely always been an issue.

http://codereview.chromium.org/8894018/diff/5015/ui/aura_shell/activation_con...
File ui/aura_shell/activation_controller.cc (right):

http://codereview.chromium.org/8894018/diff/5015/ui/aura_shell/activation_con...
ui/aura_shell/activation_controller.cc:101: if (!CanActivateWindow(window))
On 2011/12/12 18:01:16, Ben Goodger (Google) wrote:
> On 2011/12/09 23:11:23, sky wrote:
> > If we end up here because of focus change, wouldn't this mean the focus is
> left
> > in an inactive window?
> 
> I am not quite sure what you mean by this. I've added a unit test that tests
> activation changes triggered by focus changes to both top level windows and
> child windows. See activation_controller_unittest.cc.

Say you had a window that didn't want to become active that has a child. If
child->Focus() is invoked, then I believe we'll set the focus to child, but
because CanActiveWindow(parent) returns false here, the focused window is not in
the active window. This may have always been an issue though. Not sure if we
need to disallow focus going to windows that can't be active.

Powered by Google App Engine
This is Rietveld 408576698