summaryrefslogtreecommitdiffstats
path: root/ui/wm
diff options
context:
space:
mode:
authortdanderson@chromium.org <tdanderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-06 19:16:35 +0000
committertdanderson@chromium.org <tdanderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-06 19:16:35 +0000
commitc981c4fc5303e185120e59229a38f45a74a39ac0 (patch)
tree3d2f90afd6dd4436b899aad522491f51f1b6c140 /ui/wm
parent236657a27d77d295cfa3e0071fe1ede64a98e570 (diff)
downloadchromium_src-c981c4fc5303e185120e59229a38f45a74a39ac0.zip
chromium_src-c981c4fc5303e185120e59229a38f45a74a39ac0.tar.gz
chromium_src-c981c4fc5303e185120e59229a38f45a74a39ac0.tar.bz2
Some minor refactoring/cleanup between EventTargeter, ViewTargeter, and WindowTargeter
In preparation for using the unified event targeting and dispatch code for scroll events in views, make some changes to the EventTargeter, ViewTargeter, and WindowTargeter classes: * Rename WindowTargeter::WindowCanAcceptEvent() to SubtreeCanAcceptEvent() and move its declaration up into EventTargeter. Both WindowTargeter and ViewTargeter will override this function. * Move the declaration of EventLocationInsideBounds() into EventTargeter. Both WindowTargeter and ViewTargeter will override this function. * Move the implementation of WindowTargeter::SubtreeShouldBeExploredForEvent() into EventTargeter since both WindowTargeter and ViewTargeter will require identical implementations of this function. BUG=366171 TEST=none Review URL: https://codereview.chromium.org/248033004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268576 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/wm')
-rw-r--r--ui/wm/core/easy_resize_window_targeter.cc3
-rw-r--r--ui/wm/core/easy_resize_window_targeter.h4
-rw-r--r--ui/wm/core/masked_window_targeter.cc3
-rw-r--r--ui/wm/core/masked_window_targeter.h4
4 files changed, 8 insertions, 6 deletions
diff --git a/ui/wm/core/easy_resize_window_targeter.cc b/ui/wm/core/easy_resize_window_targeter.cc
index d352e52..445028c 100644
--- a/ui/wm/core/easy_resize_window_targeter.cc
+++ b/ui/wm/core/easy_resize_window_targeter.cc
@@ -24,8 +24,9 @@ EasyResizeWindowTargeter::~EasyResizeWindowTargeter() {
}
bool EasyResizeWindowTargeter::EventLocationInsideBounds(
- aura::Window* window,
+ ui::EventTarget* target,
const ui::LocatedEvent& event) const {
+ aura::Window* window = static_cast<aura::Window*>(target);
if (ShouldUseExtendedBounds(window)) {
// Note that |event|'s location is in |window|'s parent's coordinate system,
// so convert it to |window|'s coordinate system first.
diff --git a/ui/wm/core/easy_resize_window_targeter.h b/ui/wm/core/easy_resize_window_targeter.h
index 90b0848..35b9eb2 100644
--- a/ui/wm/core/easy_resize_window_targeter.h
+++ b/ui/wm/core/easy_resize_window_targeter.h
@@ -31,9 +31,9 @@ class WM_EXPORT EasyResizeWindowTargeter : public aura::WindowTargeter {
touch_extend_ = touch_extend;
}
- // aura::WindowTargeter:
+ // ui::EventTargeter:
virtual bool EventLocationInsideBounds(
- aura::Window* window,
+ ui::EventTarget* target,
const ui::LocatedEvent& event) const OVERRIDE;
private:
diff --git a/ui/wm/core/masked_window_targeter.cc b/ui/wm/core/masked_window_targeter.cc
index 4cc26d5..5cbdb19 100644
--- a/ui/wm/core/masked_window_targeter.cc
+++ b/ui/wm/core/masked_window_targeter.cc
@@ -16,8 +16,9 @@ MaskedWindowTargeter::MaskedWindowTargeter(aura::Window* masked_window)
MaskedWindowTargeter::~MaskedWindowTargeter() {}
bool MaskedWindowTargeter::EventLocationInsideBounds(
- aura::Window* window,
+ ui::EventTarget* target,
const ui::LocatedEvent& event) const {
+ aura::Window* window = static_cast<aura::Window*>(target);
if (window == masked_window_) {
gfx::Path mask;
if (!GetHitTestMask(window, &mask))
diff --git a/ui/wm/core/masked_window_targeter.h b/ui/wm/core/masked_window_targeter.h
index 46cf4d2..61bb3b1e 100644
--- a/ui/wm/core/masked_window_targeter.h
+++ b/ui/wm/core/masked_window_targeter.h
@@ -24,9 +24,9 @@ class WM_EXPORT MaskedWindowTargeter : public aura::WindowTargeter {
// coordinate system). Returns whether a valid mask has been set in |mask|.
virtual bool GetHitTestMask(aura::Window* window, gfx::Path* mask) const = 0;
- // aura::WindowTargeter:
+ // ui::EventTargeter:
virtual bool EventLocationInsideBounds(
- aura::Window* window,
+ ui::EventTarget* target,
const ui::LocatedEvent& event) const OVERRIDE;
private: