summaryrefslogtreecommitdiffstats
path: root/views/touchui
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-19 19:29:47 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-19 19:29:47 +0000
commitda77c28d914f2bde774beaf1a60fb05750836d56 (patch)
treea5bec75353350201711dd63d742c378e94ad7772 /views/touchui
parent46db5eaeb15f0fbc9a24e43315c902f3038cc0fe (diff)
downloadchromium_src-da77c28d914f2bde774beaf1a60fb05750836d56.zip
chromium_src-da77c28d914f2bde774beaf1a60fb05750836d56.tar.gz
chromium_src-da77c28d914f2bde774beaf1a60fb05750836d56.tar.bz2
touch: Gesture manager receives the touch-sequence status.
OnTouchEvent now returns the status of the touch sequence, instead of a simple bool. The gesture manager can presumably make a better decision if this information is available to it. For more details: http://codereview.chromium.org/6347002/ BUG=none TEST=ViewTest.TouchEvent Review URL: http://codereview.chromium.org/6253005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71824 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/touchui')
-rw-r--r--views/touchui/gesture_manager.cc6
-rw-r--r--views/touchui/gesture_manager.h10
2 files changed, 7 insertions, 9 deletions
diff --git a/views/touchui/gesture_manager.cc b/views/touchui/gesture_manager.cc
index 05e0ced..424470c 100644
--- a/views/touchui/gesture_manager.cc
+++ b/views/touchui/gesture_manager.cc
@@ -22,9 +22,9 @@ GestureManager* GestureManager::GetInstance() {
bool GestureManager::ProcessTouchEventForGesture(const TouchEvent& event,
View* source,
- bool previouslyHandled) {
- if (previouslyHandled)
- return false;
+ View::TouchStatus status) {
+ if (status != View::TOUCH_STATUS_UNKNOWN)
+ return false; // The event was consumed by a touch sequence.
// TODO(rjkroege): A realistic version of the GestureManager will
// appear in a subsequent CL. This interim version permits verifying that the
diff --git a/views/touchui/gesture_manager.h b/views/touchui/gesture_manager.h
index f26aa98..492a4e6 100644
--- a/views/touchui/gesture_manager.h
+++ b/views/touchui/gesture_manager.h
@@ -7,12 +7,11 @@
#pragma once
#include "base/singleton.h"
+#include "views/view.h"
namespace views {
-class View;
class TouchEvent;
-
// A GestureManager singleton detects gestures occurring in the
// incoming feed of touch events across all of the RootViews in
// the system. In response to a given touch event, the GestureManager
@@ -25,17 +24,16 @@ class GestureManager {
static GestureManager* GetInstance();
- // TODO(sad): Use TouchStatus instead of bool for previouslyHandled.
// Invoked for each touch event that could contribute to the current gesture.
// Takes the event and the View that originated it and which will also
- // be the target of any generated synthetic event. Finally, handled
- // specifies if the event was actually handled explicitly by a view so that
+ // be the target of any generated synthetic event. Finally, status
+ // specifies if a touch sequence is in progress or not, so that the
// GestureManager state can correctly reflect events that are handled
// already.
// Returns true if the event resulted in firing a synthetic event.
virtual bool ProcessTouchEventForGesture(const TouchEvent& event,
View* source,
- bool previouslyHandled);
+ View::TouchStatus status);
// TODO(rjkroege): Write the remainder of this class.
// It will appear in a subsequent CL.