diff options
author | rjkroege@google.com <rjkroege@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-08 14:06:10 +0000 |
---|---|---|
committer | rjkroege@google.com <rjkroege@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-08 14:06:10 +0000 |
commit | ad84c8f53a2973e4d752de9fe8c52e3268a867e1 (patch) | |
tree | cb330cc04d3b0dd3a93eca847e367d794310653c /views/widget/root_view.h | |
parent | 2229e8264e786f5265bf5c0a6265d5aa3dfaf713 (diff) | |
download | chromium_src-ad84c8f53a2973e4d752de9fe8c52e3268a867e1.zip chromium_src-ad84c8f53a2973e4d752de9fe8c52e3268a867e1.tar.gz chromium_src-ad84c8f53a2973e4d752de9fe8c52e3268a867e1.tar.bz2 |
Added entry points to view/View to dispatch and process TouchEvents.
This change is part of a series of changes to bring TouchEvent
processing to views.
BUG=na
TESTED=compiled with and without touchui
Review URL: http://codereview.chromium.org/3192002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58823 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget/root_view.h')
-rw-r--r-- | views/widget/root_view.h | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/views/widget/root_view.h b/views/widget/root_view.h index c749bc8..91c1672 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_ |