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

Side by Side Diff: views/touchui/gesture_manager.h

Issue 6347002: touch: Return an enum from OnTouchEvent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add TODO, look for TOUCH_STATUS_START. Created 9 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef VIEWS_TOUCHUI_GESTURE_MANAGER_H_ 5 #ifndef VIEWS_TOUCHUI_GESTURE_MANAGER_H_
6 #define VIEWS_TOUCHUI_GESTURE_MANAGER_H_ 6 #define VIEWS_TOUCHUI_GESTURE_MANAGER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/singleton.h" 9 #include "base/singleton.h"
10 10
11 namespace views { 11 namespace views {
12 class View; 12 class View;
13 class TouchEvent; 13 class TouchEvent;
14 14
15 15
16 // A GestureManager singleton detects gestures occurring in the 16 // A GestureManager singleton detects gestures occurring in the
17 // incoming feed of touch events across all of the RootViews in 17 // incoming feed of touch events across all of the RootViews in
18 // the system. In response to a given touch event, the GestureManager 18 // the system. In response to a given touch event, the GestureManager
19 // updates its internal state and optionally dispatches synthetic 19 // updates its internal state and optionally dispatches synthetic
20 // events to the invoking view. 20 // events to the invoking view.
21 // 21 //
22 class GestureManager { 22 class GestureManager {
23 public: 23 public:
24 virtual ~GestureManager(); 24 virtual ~GestureManager();
25 25
26 static GestureManager* GetInstance(); 26 static GestureManager* GetInstance();
27 27
28 // TODO(sad): Use TouchStatus instead of bool for previouslyHandled.
28 // Invoked for each touch event that could contribute to the current gesture. 29 // Invoked for each touch event that could contribute to the current gesture.
29 // Takes the event and the View that originated it and which will also 30 // Takes the event and the View that originated it and which will also
30 // be the target of any generated synthetic event. Finally, handled 31 // be the target of any generated synthetic event. Finally, handled
31 // specifies if the event was actually handled explicitly by a view so that 32 // specifies if the event was actually handled explicitly by a view so that
32 // GestureManager state can correctly reflect events that are handled 33 // GestureManager state can correctly reflect events that are handled
33 // already. 34 // already.
34 // Returns true if the event resulted in firing a synthetic event. 35 // Returns true if the event resulted in firing a synthetic event.
35 virtual bool ProcessTouchEventForGesture(const TouchEvent& event, 36 virtual bool ProcessTouchEventForGesture(const TouchEvent& event,
36 View* source, 37 View* source,
37 bool previouslyHandled); 38 bool previouslyHandled);
38 39
39 // TODO(rjkroege): Write the remainder of this class. 40 // TODO(rjkroege): Write the remainder of this class.
40 // It will appear in a subsequent CL. 41 // It will appear in a subsequent CL.
41 42
42 protected: 43 protected:
43 GestureManager(); 44 GestureManager();
44 45
45 private: 46 private:
46 friend struct DefaultSingletonTraits<GestureManager>; 47 friend struct DefaultSingletonTraits<GestureManager>;
47 48
48 DISALLOW_COPY_AND_ASSIGN(GestureManager); 49 DISALLOW_COPY_AND_ASSIGN(GestureManager);
49 }; 50 };
50 51
51 52
52 } // namespace views 53 } // namespace views
53 54
54 #endif // VIEWS_TOUCHUI_GESTURE_MANAGER_H_ 55 #endif // VIEWS_TOUCHUI_GESTURE_MANAGER_H_
OLDNEW
« no previous file with comments | « views/focus/accelerator_handler_touch.cc ('k') | views/view.h » ('j') | views/view.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698