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

Unified Diff: views/widget/root_view.h

Issue 3192002: Added entry points to view/View to dispatch and process TouchEvents. (Closed) Base URL: git://codf21.jail.google.com/chromium.git
Patch Set: final changes Created 10 years, 3 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 | « views/views.gyp ('k') | views/widget/root_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/root_view.h
diff --git a/views/widget/root_view.h b/views/widget/root_view.h
index c749bc8cf0e79fc55747846b522bb47948730caf..91c1672d1c4d1362c9c85d34decdfa7850cdbadf 100644
--- a/views/widget/root_view.h
+++ b/views/widget/root_view.h
@@ -22,6 +22,10 @@ namespace views {
class PaintTask;
class Widget;
+#if defined(TOUCH_UI)
+class GestureManager;
+#endif
+
/////////////////////////////////////////////////////////////////////////////
//
// RootView class
@@ -93,6 +97,9 @@ class RootView : public View,
virtual void OnMouseReleased(const MouseEvent& e, bool canceled);
virtual void OnMouseMoved(const MouseEvent& e);
virtual void SetMouseHandler(View* new_mouse_handler);
+#if defined(TOUCH_UI)
+ virtual bool OnTouchEvent(const TouchEvent& e);
+#endif
// Invoked By the Widget if the mouse drag is interrupted by
// the system. Invokes OnMouseReleased with a value of true for canceled.
@@ -175,6 +182,12 @@ class RootView : public View,
// Accessibility accessors/mutators, overridden from View.
virtual bool GetAccessibleRole(AccessibilityTypes::Role* role);
+#if defined(TOUCH_UI) && defined(UNIT_TEST)
+ // For unit testing purposes, we use this method to set a mock
+ // GestureManager
+ void SetGestureManager(GestureManager* g) { gesture_manager_ = g; }
+#endif
+
protected:
// Overridden to properly reset our event propagation member
@@ -189,6 +202,12 @@ class RootView : public View,
friend class View;
friend class PaintTask;
+#if defined(TOUCH_UI)
+ // Required so the GestureManager can call the Process* entry points
+ // with synthetic events as necessary.
+ friend class GestureManager;
+#endif
+
RootView();
// Convert a point to our current mouse handler. Returns false if the
@@ -321,14 +340,20 @@ class RootView : public View,
// view the drag started from.
View* drag_view_;
+#if defined(TOUCH_UI)
+ // The gesture_manager_ for this.
+ GestureManager* gesture_manager_;
+
+ // The view currently handling touch events.
+ View *touch_pressed_handler_;
+#endif
+
#ifndef NDEBUG
// True if we're currently processing paint.
bool is_processing_paint_;
#endif
-
DISALLOW_COPY_AND_ASSIGN(RootView);
};
-
} // namespace views
#endif // VIEWS_WIDGET_ROOT_VIEW_H_
« no previous file with comments | « views/views.gyp ('k') | views/widget/root_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698