From 4e04e997d607cbf02d2963fea956c25a1a5071e5 Mon Sep 17 00:00:00 2001 From: "ben@chromium.org" Date: Fri, 30 Nov 2012 22:15:01 +0000 Subject: 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 --- ash/test/test_activation_delegate.cc | 2 +- ash/test/test_activation_delegate.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'ash/test') 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); }; -- cgit v1.1