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

Unified Diff: views/widget/root_view.h

Issue 8364039: Initial views touchui GestureRecognizer support (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Reverted chrome_switches.cc changes and TOT sync up Created 9 years, 1 month 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
Index: views/widget/root_view.h
diff --git a/views/widget/root_view.h b/views/widget/root_view.h
index 3a2afb990e909c08c6b63d31472c19536441f88d..f60c0df8c1c00a297191befd18004f3248b31758 100644
--- a/views/widget/root_view.h
+++ b/views/widget/root_view.h
@@ -21,6 +21,7 @@ namespace views {
class Widget;
class GestureManager;
+class GestureRecognizer;
// This is a views-internal API and should not be used externally.
// Widget exposes this object as a View*.
@@ -71,6 +72,9 @@ class VIEWS_EXPORT RootView : public View, public FocusTraversable {
// Provided only for testing:
void SetGestureManagerForTesting(GestureManager* g) { gesture_manager_ = g; }
+ void SetGestureRecognizerForTesting(GestureRecognizer* gr) {
+ gesture_recognizer_ = gr;
+ }
// Focus ---------------------------------------------------------------------
@@ -110,6 +114,7 @@ class VIEWS_EXPORT RootView : public View, public FocusTraversable {
virtual void OnMouseExited(const MouseEvent& event) OVERRIDE;
virtual bool OnMouseWheel(const MouseWheelEvent& event) OVERRIDE;
virtual ui::TouchStatus OnTouchEvent(const TouchEvent& event) OVERRIDE;
+ virtual ui::GestureStatus OnGestureEvent(const GestureEvent& event) OVERRIDE;
virtual void SetMouseHandler(View* new_mouse_handler) OVERRIDE;
virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
@@ -144,6 +149,10 @@ class VIEWS_EXPORT RootView : public View, public FocusTraversable {
// be applied to the point prior to calling this).
void SetMouseLocationAndFlags(const MouseEvent& event);
+ // Feeds touch event to GestureRecognizer.
+ // Returns true if the event resulted in firing a synthetic event.
+ bool DoGestureProcessing(const TouchEvent& event, ui::TouchStatus status);
+
//////////////////////////////////////////////////////////////////////////////
// Tree operations -----------------------------------------------------------
@@ -178,6 +187,12 @@ class VIEWS_EXPORT RootView : public View, public FocusTraversable {
// The view currently handling touch events.
View* touch_pressed_handler_;
+ // The gesture_recognizer_ for this.
+ GestureRecognizer* gesture_recognizer_;
+
+ // The view currently handling gesture events.
+ View* gesture_handling_view_;
+
// Focus ---------------------------------------------------------------------
// The focus search algorithm.

Powered by Google App Engine
This is Rietveld 408576698