diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-30 21:32:43 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-30 21:32:43 +0000 |
commit | 62ba64f0f284b5fbff074a430df77c85a8bd20d0 (patch) | |
tree | ee3d64aabea681c571c012b05e63ed0c967124d8 /ash | |
parent | 3e2dbbc1fa2f7160ecb0b88e58f6c4422ac3ec67 (diff) | |
download | chromium_src-62ba64f0f284b5fbff074a430df77c85a8bd20d0.zip chromium_src-62ba64f0f284b5fbff074a430df77c85a8bd20d0.tar.gz chromium_src-62ba64f0f284b5fbff074a430df77c85a8bd20d0.tar.bz2 |
Revert 170477 - Removes the |event| parameter from ActivationDelegate::ShouldActivate and makes the method const.
It is mostly unused, except for one place in RenderWidgetHostViewAura, where depending on the event type etc it will have a consequence. I think it's bad for a method with a const-sounding name like "ShouldActivate" to have side-effects.
Instead, I made the RWHVA store the data that would indicate a pointer activate and check that state during OnActivated(). It'd be a little cleaner if OnActivated had some way of knowing what the currently processed input event was, hence the TODO.
http://crbug.com/162100
R=sadrul@chromium.org
Review URL: https://codereview.chromium.org/11419251
TBR=ben@chromium.org
Review URL: https://codereview.chromium.org/11416292
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170550 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/test/test_activation_delegate.cc | 2 | ||||
-rw-r--r-- | ash/test/test_activation_delegate.h | 4 | ||||
-rw-r--r-- | ash/wm/activation_controller.cc | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/ash/test/test_activation_delegate.cc b/ash/test/test_activation_delegate.cc index 88b5f13..53eb6eb 100644 --- a/ash/test/test_activation_delegate.cc +++ b/ash/test/test_activation_delegate.cc @@ -38,7 +38,7 @@ void TestActivationDelegate::SetWindow(aura::Window* window) { aura::client::SetActivationDelegate(window, this); } -bool TestActivationDelegate::ShouldActivate() const { +bool TestActivationDelegate::ShouldActivate(const ui::Event* event) { should_activate_count_++; return activate_; } diff --git a/ash/test/test_activation_delegate.h b/ash/test/test_activation_delegate.h index 185e65d..296c903 100644 --- a/ash/test/test_activation_delegate.h +++ b/ash/test/test_activation_delegate.h @@ -37,7 +37,7 @@ class TestActivationDelegate : public aura::client::ActivationDelegate { } // Overridden from client::ActivationDelegate: - virtual bool ShouldActivate() const OVERRIDE; + virtual bool ShouldActivate(const ui::Event* event) OVERRIDE; virtual void OnActivated() OVERRIDE; virtual void OnLostActive() OVERRIDE; @@ -47,7 +47,7 @@ class TestActivationDelegate : public aura::client::ActivationDelegate { bool activate_; int activated_count_; int lost_active_count_; - mutable int should_activate_count_; + int should_activate_count_; DISALLOW_COPY_AND_ASSIGN(TestActivationDelegate); }; diff --git a/ash/wm/activation_controller.cc b/ash/wm/activation_controller.cc index 3138fd8..f421dc0 100644 --- a/ash/wm/activation_controller.cc +++ b/ash/wm/activation_controller.cc @@ -111,7 +111,7 @@ bool CanActivateWindowWithEvent(aura::Window* window, return window && VisibilityMatches(window, visibility_type) && (!aura::client::GetActivationDelegate(window) || - aura::client::GetActivationDelegate(window)->ShouldActivate()) && + aura::client::GetActivationDelegate(window)->ShouldActivate(event)) && SupportsChildActivation(window->parent()) && (BelongsToContainerWithEqualOrGreaterId( window, kShellWindowId_SystemModalContainer) || |