Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef GestureManager_h | |
| 6 #define GestureManager_h | |
| 7 | |
| 8 #include "core/CoreExport.h" | |
| 9 #include "core/frame/LocalFrame.h" | |
| 10 #include "core/layout/HitTestRequest.h" | |
| 11 #include "core/page/EventWithHitTestResults.h" | |
| 12 #include "platform/PlatformEvent.h" | |
| 13 #include "public/platform/WebInputEventResult.h" | |
| 14 | |
| 15 namespace blink { | |
| 16 | |
| 17 class ScrollManager; | |
| 18 class SelectionController; | |
| 19 class PointerEventManager; | |
| 20 | |
| 21 // This class takes care of gestures and delegating the action based on the | |
| 22 // gesture to the responsible class. | |
| 23 class CORE_EXPORT GestureManager { | |
| 24 WTF_MAKE_NONCOPYABLE(GestureManager); | |
| 25 DISALLOW_NEW(); | |
| 26 public: | |
| 27 explicit GestureManager(LocalFrame*, ScrollManager*, PointerEventManager*, | |
|
dtapuska
2016/07/13 12:19:28
no need for explicit. Explicit is only used when y
Navid Zolghadr
2016/07/13 16:28:14
It was carried over from a copy paste. Removed.
| |
| 28 SelectionController*); | |
| 29 ~GestureManager(); | |
| 30 DECLARE_TRACE(); | |
| 31 | |
| 32 void clear(); | |
| 33 | |
| 34 HitTestRequest::HitTestRequestType getHitTypeForGestureType(PlatformEvent::E ventType); | |
| 35 WebInputEventResult handleGestureEventInFrame(const GestureEventWithHitTestR esults&); | |
| 36 | |
| 37 // TODO(nzolghadr): This can probably be hidden and the related logic | |
| 38 // be moved to this class (see crrev.com/112023010). Since that might cause | |
| 39 // regression it's better to move that logic in another change. | |
| 40 double getLastShowPressTimestamp(); | |
|
dtapuska
2016/07/13 12:19:28
can be const
Navid Zolghadr
2016/07/13 16:28:14
Sure.
| |
| 41 | |
| 42 private: | |
| 43 | |
| 44 WebInputEventResult handleGestureShowPress(); | |
| 45 WebInputEventResult handleGestureTapDown(const GestureEventWithHitTestResult s&); | |
| 46 WebInputEventResult handleGestureTap(const GestureEventWithHitTestResults&); | |
| 47 WebInputEventResult handleGestureLongPress(const GestureEventWithHitTestResu lts&); | |
| 48 WebInputEventResult handleGestureLongTap(const GestureEventWithHitTestResult s&); | |
| 49 | |
| 50 FrameHost* frameHost() const; | |
| 51 | |
| 52 // NOTE: If adding a new field to this class please ensure that it is | |
| 53 // cleared if needed in |GestureManager::clear()|. | |
| 54 | |
| 55 const Member<LocalFrame> m_frame; | |
| 56 | |
| 57 ScrollManager* m_scrollManager; | |
| 58 PointerEventManager* m_pointerEventManager; | |
| 59 | |
| 60 // Set on GestureTapDown if the |pointerdown| event corresponding to the | |
| 61 // triggering |touchstart| event was canceled. This suppresses mouse event | |
| 62 // firing for the current gesture sequence (i.e. until next GestureTapDown). | |
| 63 bool m_suppressMouseEventsFromGestures; | |
| 64 | |
| 65 bool m_longTapShouldInvokeContextMenu; | |
| 66 | |
| 67 const Member<SelectionController> m_selectionController; | |
| 68 | |
| 69 double m_lastShowPressTimestamp; | |
| 70 | |
| 71 }; | |
| 72 | |
| 73 } // namespace blink | |
| 74 | |
| 75 #endif // GestureManager_h | |
| OLD | NEW |