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

Unified Diff: ui/views/view.h

Issue 10938009: Views fuzzing for Aura and Windows (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Work in progress. Created 8 years, 2 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 | « chrome/browser/ui/views/tabs/tab_strip.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »
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 2d028ef289e32b96e6c48006160f5199f2ad9af8..407ceaa0281c1fe67858de9daeda8463a5d8804b 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 |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 ConvertRectToTarget(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,7 +509,23 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// view's coordinates, except for a RootView.
// Returns the deepest visible descendant that contains the specified point.
- virtual View* GetEventHandlerForPoint(const gfx::Point& point);
+ View* GetEventHandlerForPoint(const gfx::Point& point);
+
+ // Returns the appropriate event handler for the given touch rect.
+ View* GetEventHandlerForRect(const gfx::Rect& rect);
+
+ // Flags the event type, so that a single GetEvent routine can handle both.
+ enum EventType { EVENT_HANDLER_TYPE_MOUSE, EVENT_HANDLER_TYPE_TOUCH };
+
+ // Returns the appropriate event handler for the given |rect|. Location will
+ // either be a rect (for a touch event) or a point (as a 1X1 rect) for a
+ // mouse event.
+ // 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* GetEventHandler(const gfx::Rect& rect, EventType type);
// 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
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698