diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-30 22:15:01 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-30 22:15:01 +0000 |
commit | 4e04e997d607cbf02d2963fea956c25a1a5071e5 (patch) | |
tree | c2e93d6bd0a136ab7eee3f7085f909fd80c3197f /ash/test | |
parent | 8b6f277c6a09730cdbd0d0c776d7438aacc18903 (diff) | |
download | chromium_src-4e04e997d607cbf02d2963fea956c25a1a5071e5.zip chromium_src-4e04e997d607cbf02d2963fea956c25a1a5071e5.tar.gz chromium_src-4e04e997d607cbf02d2963fea956c25a1a5071e5.tar.bz2 |
Revert 170550 - 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
TBR=ben@chromium.org
Review URL: https://codereview.chromium.org/11434062
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170571 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/test')
-rw-r--r-- | ash/test/test_activation_delegate.cc | 2 | ||||
-rw-r--r-- | ash/test/test_activation_delegate.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/ash/test/test_activation_delegate.cc b/ash/test/test_activation_delegate.cc index 53eb6eb..88b5f13 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 ui::Event* event) { +bool TestActivationDelegate::ShouldActivate() const { should_activate_count_++; return activate_; } diff --git a/ash/test/test_activation_delegate.h b/ash/test/test_activation_delegate.h index 296c903..185e65d 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 ui::Event* event) OVERRIDE; + virtual bool ShouldActivate() const 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_; - int should_activate_count_; + mutable int should_activate_count_; DISALLOW_COPY_AND_ASSIGN(TestActivationDelegate); }; |