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

Unified Diff: ui/views/view.h

Issue 10790019: Add gesture target fuzzing to views (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: No longer using screen coordinates Created 8 years, 4 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/events/event.cc ('k') | ui/views/view.cc » ('j') | ui/views/view.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.h
diff --git a/ui/views/view.h b/ui/views/view.h
index 9482cefa86b0b5b57bc7dc12250bbc8602425846..83efc7b7d4e43cd75eb2afb46f77e73149fc7ab7 100644
--- a/ui/views/view.h
+++ b/ui/views/view.h
@@ -410,6 +410,15 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
const View* target,
gfx::Point* point);
+ // Convert a rect from the coordinate system of one View to another.
+ //
+ // |source| and |target| must be in the same widget, but doesn't need to be in
+ // the same view hierarchy.
+ // |source| can be NULL in which case it means the screen coordinate system.
+ static void ConvertRectToView(const View* source,
+ const View* target,
+ gfx::Rect* rect);
+
// Convert a point from a View's coordinate system to that of its Widget.
static void ConvertPointToWidget(const View* src, gfx::Point* point);
@@ -500,8 +509,17 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// view's coordinates, except for a RootView.
// Returns the deepest visible descendant that contains the specified point.
+ // Note that if you are overriding GetEventHandlerForPoint, you will likely
+ // also want to override GetEventHandlerForRect.
virtual View* GetEventHandlerForPoint(const gfx::Point& point);
+ // Considers the bounding rectangles of all leaf descendant views that have
+ // at least views::kFuzzingOverlapPercentage of their area covered by
+ // |rect|. Among these rectangles, choose one that is closest to the center
+ // line of |rect| and return its corresponding View. If there are no such
+ // rectangles, NULL is returned.
+ virtual View* GetEventHandlerForRect(const gfx::Rect& rect);
+
// Return the cursor that should be used for this view or the default cursor.
// The event location is in the receiver's coordinate system. The caller is
// responsible for managing the lifetime of the returned object, though that
« no previous file with comments | « ui/views/events/event.cc ('k') | ui/views/view.cc » ('j') | ui/views/view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698