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

Side by Side Diff: third_party/WebKit/Source/core/input/GestureManager.h

Issue 2255323004: Create MouseEventManager and EventHandlingUtil (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 GestureManager_h 5 #ifndef GestureManager_h
6 #define GestureManager_h 6 #define GestureManager_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "core/frame/LocalFrame.h" 9 #include "core/frame/LocalFrame.h"
10 #include "core/layout/HitTestRequest.h" 10 #include "core/layout/HitTestRequest.h"
11 #include "core/page/EventWithHitTestResults.h" 11 #include "core/page/EventWithHitTestResults.h"
12 #include "platform/PlatformEvent.h" 12 #include "platform/PlatformEvent.h"
13 #include "public/platform/WebInputEventResult.h" 13 #include "public/platform/WebInputEventResult.h"
14 14
15 namespace blink { 15 namespace blink {
16 16
17 class ScrollManager; 17 class ScrollManager;
18 class SelectionController; 18 class SelectionController;
19 class PointerEventManager; 19 class PointerEventManager;
20 20
21 // This class takes care of gestures and delegating the action based on the 21 // This class takes care of gestures and delegating the action based on the
22 // gesture to the responsible class. 22 // gesture to the responsible class.
23 class CORE_EXPORT GestureManager { 23 class CORE_EXPORT GestureManager : public GarbageCollectedFinalized<GestureManag er> {
24 WTF_MAKE_NONCOPYABLE(GestureManager); 24 WTF_MAKE_NONCOPYABLE(GestureManager);
25 DISALLOW_NEW();
26 25
27 public: 26 public:
28 GestureManager(LocalFrame*, ScrollManager*, PointerEventManager*, 27 GestureManager(LocalFrame*, ScrollManager*, PointerEventManager*,
29 SelectionController*); 28 SelectionController*);
30 ~GestureManager();
31 DECLARE_TRACE(); 29 DECLARE_TRACE();
32 30
33 void clear(); 31 void clear();
34 32
35 HitTestRequest::HitTestRequestType getHitTypeForGestureType(PlatformEvent::E ventType); 33 HitTestRequest::HitTestRequestType getHitTypeForGestureType(PlatformEvent::E ventType);
36 WebInputEventResult handleGestureEventInFrame(const GestureEventWithHitTestR esults&); 34 WebInputEventResult handleGestureEventInFrame(const GestureEventWithHitTestR esults&);
37 35
38 // TODO(nzolghadr): This can probably be hidden and the related logic 36 // TODO(nzolghadr): This can probably be hidden and the related logic
39 // be moved to this class (see crrev.com/112023010). Since that might cause 37 // be moved to this class (see crrev.com/112023010). Since that might cause
40 // regression it's better to move that logic in another change. 38 // regression it's better to move that logic in another change.
41 double getLastShowPressTimestamp() const; 39 double getLastShowPressTimestamp() const;
42 40
43 private: 41 private:
44 WebInputEventResult handleGestureShowPress(); 42 WebInputEventResult handleGestureShowPress();
45 WebInputEventResult handleGestureTapDown(const GestureEventWithHitTestResult s&); 43 WebInputEventResult handleGestureTapDown(const GestureEventWithHitTestResult s&);
46 WebInputEventResult handleGestureTap(const GestureEventWithHitTestResults&); 44 WebInputEventResult handleGestureTap(const GestureEventWithHitTestResults&);
47 WebInputEventResult handleGestureLongPress(const GestureEventWithHitTestResu lts&); 45 WebInputEventResult handleGestureLongPress(const GestureEventWithHitTestResu lts&);
48 WebInputEventResult handleGestureLongTap(const GestureEventWithHitTestResult s&); 46 WebInputEventResult handleGestureLongTap(const GestureEventWithHitTestResult s&);
49 WebInputEventResult handleGestureTwoFingerTap(const GestureEventWithHitTestR esults&); 47 WebInputEventResult handleGestureTwoFingerTap(const GestureEventWithHitTestR esults&);
50 48
51 WebInputEventResult sendContextMenuEventForGesture(const GestureEventWithHit TestResults&); 49 WebInputEventResult sendContextMenuEventForGesture(const GestureEventWithHit TestResults&);
52 50
53 FrameHost* frameHost() const; 51 FrameHost* frameHost() const;
54 52
55 // NOTE: If adding a new field to this class please ensure that it is 53 // NOTE: If adding a new field to this class please ensure that it is
56 // cleared if needed in |GestureManager::clear()|. 54 // cleared if needed in |GestureManager::clear()|.
57 55
58 const Member<LocalFrame> m_frame; 56 const Member<LocalFrame> m_frame;
59 57
60 ScrollManager* m_scrollManager; 58 Member<ScrollManager> m_scrollManager;
61 PointerEventManager* m_pointerEventManager; 59 Member<PointerEventManager> m_pointerEventManager;
62 60
63 // Set on GestureTapDown if the |pointerdown| event corresponding to the 61 // Set on GestureTapDown if the |pointerdown| event corresponding to the
64 // triggering |touchstart| event was canceled. This suppresses mouse event 62 // triggering |touchstart| event was canceled. This suppresses mouse event
65 // firing for the current gesture sequence (i.e. until next GestureTapDown). 63 // firing for the current gesture sequence (i.e. until next GestureTapDown).
66 bool m_suppressMouseEventsFromGestures; 64 bool m_suppressMouseEventsFromGestures;
67 65
68 bool m_longTapShouldInvokeContextMenu; 66 bool m_longTapShouldInvokeContextMenu;
69 67
70 const Member<SelectionController> m_selectionController; 68 const Member<SelectionController> m_selectionController;
71 69
72 double m_lastShowPressTimestamp; 70 double m_lastShowPressTimestamp;
73 }; 71 };
74 72
75 } // namespace blink 73 } // namespace blink
76 74
77 #endif // GestureManager_h 75 #endif // GestureManager_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/input/EventHandlingUtil.cpp ('k') | third_party/WebKit/Source/core/input/GestureManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698