diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-18 19:08:01 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-18 19:08:01 +0000 |
commit | 2839e0061402c2f6d9d409e67850e9e708defa8d (patch) | |
tree | ed7090ef4e9bdcfa295b64aea49be5180d11b5d7 /views/view.h | |
parent | da7abbb92e3cb6774f91ab37571bca6aaaa7b41a (diff) | |
download | chromium_src-2839e0061402c2f6d9d409e67850e9e708defa8d.zip chromium_src-2839e0061402c2f6d9d409e67850e9e708defa8d.tar.gz chromium_src-2839e0061402c2f6d9d409e67850e9e708defa8d.tar.bz2 |
touch: Return an enum from OnTouchEvent.
The enum returned from OnTouchEvent reflects the current status of the touch-sequence. This can be used by the RootView to determine when the touch-event-handler should be reset.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6347002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71677 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/view.h')
-rw-r--r-- | views/view.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/views/view.h b/views/view.h index 3c77e03..02111b0 100644 --- a/views/view.h +++ b/views/view.h @@ -133,6 +133,19 @@ class View : public AcceleratorTarget { APPLY_MIRRORING_TRANSFORMATION }; +#if defined(TOUCH_UI) + enum TouchStatus { + TOUCH_STATUS_UNKNOWN = 0, // Unknown touch status. This is used to indicate + // that the touch event was not handled. + TOUCH_STATUS_START, // The touch event initiated a touch sequence. + TOUCH_STATUS_CONTINUE, // The touch event is part of a previously + // started touch sequence. + TOUCH_STATUS_END, // The touch event ended the touch sequence. + TOUCH_STATUS_CANCEL // The touch event was cancelled, but didn't + // terminate the touch sequence. + }; +#endif + // The view class name. static char kViewClassName[]; @@ -699,7 +712,7 @@ class View : public AcceleratorTarget { #if defined(TOUCH_UI) // This method is invoked for each touch event. Default implementation // does nothing. Override as needed. - virtual bool OnTouchEvent(const TouchEvent& event); + virtual TouchStatus OnTouchEvent(const TouchEvent& event); #endif // Set the MouseHandler for a drag session. @@ -1159,9 +1172,8 @@ class View : public AcceleratorTarget { #if defined(TOUCH_UI) // RootView will invoke this with incoming TouchEvents. Returns the - // the result of OnTouchEvent: true if the event was handled by the - // callee. - bool ProcessTouchEvent(const TouchEvent& e); + // the result of OnTouchEvent. + TouchStatus ProcessTouchEvent(const TouchEvent& e); #endif // Starts a drag and drop operation originating from this view. This invokes |