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

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

Issue 2350433002: Extract more of the mouse logic from EventHandler (Closed)
Patch Set: 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 class MouseEventManager;
20 21
21 // This class takes care of gestures and delegating the action based on the 22 // This class takes care of gestures and delegating the action based on the
22 // gesture to the responsible class. 23 // gesture to the responsible class.
23 class CORE_EXPORT GestureManager : public GarbageCollectedFinalized<GestureManag er> { 24 class CORE_EXPORT GestureManager : public GarbageCollectedFinalized<GestureManag er> {
24 WTF_MAKE_NONCOPYABLE(GestureManager); 25 WTF_MAKE_NONCOPYABLE(GestureManager);
25 26
26 public: 27 public:
27 GestureManager(LocalFrame*, ScrollManager*, PointerEventManager*, 28 GestureManager(LocalFrame*, ScrollManager*, MouseEventManager*,
28 SelectionController*); 29 PointerEventManager*, SelectionController*);
29 DECLARE_TRACE(); 30 DECLARE_TRACE();
30 31
31 void clear(); 32 void clear();
32 33
33 HitTestRequest::HitTestRequestType getHitTypeForGestureType(PlatformEvent::E ventType); 34 HitTestRequest::HitTestRequestType getHitTypeForGestureType(PlatformEvent::E ventType);
34 WebInputEventResult handleGestureEventInFrame(const GestureEventWithHitTestR esults&); 35 WebInputEventResult handleGestureEventInFrame(const GestureEventWithHitTestR esults&);
35 36
36 // TODO(nzolghadr): This can probably be hidden and the related logic 37 // TODO(nzolghadr): This can probably be hidden and the related logic
37 // be moved to this class (see crrev.com/112023010). Since that might cause 38 // be moved to this class (see crrev.com/112023010). Since that might cause
38 // regression it's better to move that logic in another change. 39 // regression it's better to move that logic in another change.
(...skipping 10 matching lines...) Expand all
49 WebInputEventResult sendContextMenuEventForGesture(const GestureEventWithHit TestResults&); 50 WebInputEventResult sendContextMenuEventForGesture(const GestureEventWithHit TestResults&);
50 51
51 FrameHost* frameHost() const; 52 FrameHost* frameHost() const;
52 53
53 // NOTE: If adding a new field to this class please ensure that it is 54 // NOTE: If adding a new field to this class please ensure that it is
54 // cleared if needed in |GestureManager::clear()|. 55 // cleared if needed in |GestureManager::clear()|.
55 56
56 const Member<LocalFrame> m_frame; 57 const Member<LocalFrame> m_frame;
57 58
58 Member<ScrollManager> m_scrollManager; 59 Member<ScrollManager> m_scrollManager;
60 Member<MouseEventManager> m_mouseEventManager;
59 Member<PointerEventManager> m_pointerEventManager; 61 Member<PointerEventManager> m_pointerEventManager;
60 62
61 // Set on GestureTapDown if the |pointerdown| event corresponding to the 63 // Set on GestureTapDown if the |pointerdown| event corresponding to the
62 // triggering |touchstart| event was canceled. This suppresses mouse event 64 // triggering |touchstart| event was canceled. This suppresses mouse event
63 // firing for the current gesture sequence (i.e. until next GestureTapDown). 65 // firing for the current gesture sequence (i.e. until next GestureTapDown).
64 bool m_suppressMouseEventsFromGestures; 66 bool m_suppressMouseEventsFromGestures;
65 67
66 bool m_longTapShouldInvokeContextMenu; 68 bool m_longTapShouldInvokeContextMenu;
67 69
68 const Member<SelectionController> m_selectionController; 70 const Member<SelectionController> m_selectionController;
69 71
70 double m_lastShowPressTimestamp; 72 double m_lastShowPressTimestamp;
71 }; 73 };
72 74
73 } // namespace blink 75 } // namespace blink
74 76
75 #endif // GestureManager_h 77 #endif // GestureManager_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698