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

Unified Diff: ui/views/view_targeter.cc

Issue 286933014: Introduce the MaskedViewTargeter class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: quick nit Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/view_targeter.h ('k') | ui/views/view_targeter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view_targeter.cc
diff --git a/ui/views/view_targeter.cc b/ui/views/view_targeter.cc
index e4f495b1bd8344ccdc9781e805b41569a1a35ed2..565141cbadb80cefbb75b91f783a4b75f9d880eb 100644
--- a/ui/views/view_targeter.cc
+++ b/ui/views/view_targeter.cc
@@ -13,6 +13,17 @@ namespace views {
ViewTargeter::ViewTargeter() {}
ViewTargeter::~ViewTargeter() {}
+gfx::RectF ViewTargeter::BoundsForEvent(const ui::LocatedEvent& event) const {
+ gfx::RectF event_bounds(event.location_f(), gfx::SizeF(1, 1));
+ if (event.IsGestureEvent()) {
+ const ui::GestureEvent& gesture =
+ static_cast<const ui::GestureEvent&>(event);
+ event_bounds = gesture.details().bounding_box_f();
+ }
+
+ return event_bounds;
+}
+
ui::EventTarget* ViewTargeter::FindTargetForEvent(ui::EventTarget* root,
ui::Event* event) {
View* view = static_cast<View*>(root);
« no previous file with comments | « ui/views/view_targeter.h ('k') | ui/views/view_targeter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698