| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 SKY_ENGINE_CORE_FRAME_NEWEVENTHANDLER_H_ | 5 #ifndef SKY_ENGINE_CORE_FRAME_NEWEVENTHANDLER_H_ |
| 6 #define SKY_ENGINE_CORE_FRAME_NEWEVENTHANDLER_H_ | 6 #define SKY_ENGINE_CORE_FRAME_NEWEVENTHANDLER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include "sky/engine/core/dom/Node.h" | 9 #include "sky/engine/core/dom/Node.h" |
| 10 #include "sky/engine/core/rendering/HitTestRequest.h" | 10 #include "sky/engine/core/rendering/HitTestRequest.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 public: | 24 public: |
| 25 explicit NewEventHandler(LocalFrame&); | 25 explicit NewEventHandler(LocalFrame&); |
| 26 ~NewEventHandler(); | 26 ~NewEventHandler(); |
| 27 | 27 |
| 28 bool handlePointerEvent(const WebPointerEvent&); | 28 bool handlePointerEvent(const WebPointerEvent&); |
| 29 bool handleGestureEvent(const WebGestureEvent&); | 29 bool handleGestureEvent(const WebGestureEvent&); |
| 30 bool handleKeyboardEvent(const WebKeyboardEvent&); | 30 bool handleKeyboardEvent(const WebKeyboardEvent&); |
| 31 bool handleWheelEvent(const WebWheelEvent&); | 31 bool handleWheelEvent(const WebWheelEvent&); |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 struct PointerState { |
| 35 RefPtr<Node> target; |
| 36 double x = 0; |
| 37 double y = 0; |
| 38 }; |
| 39 |
| 34 bool handlePointerDownEvent(const WebPointerEvent&); | 40 bool handlePointerDownEvent(const WebPointerEvent&); |
| 35 bool handlePointerUpEvent(const WebPointerEvent&); | 41 bool handlePointerUpEvent(const WebPointerEvent&); |
| 36 bool handlePointerMoveEvent(const WebPointerEvent&); | 42 bool handlePointerMoveEvent(const WebPointerEvent&); |
| 37 bool handlePointerCancelEvent(const WebPointerEvent&); | 43 bool handlePointerCancelEvent(const WebPointerEvent&); |
| 38 | 44 |
| 39 bool dispatchGestureEvent(Node& target, const WebGestureEvent& event); | 45 bool dispatchGestureEvent(Node& target, const WebGestureEvent& event); |
| 40 bool dispatchPointerEvent(Node& target, const WebPointerEvent&); | 46 bool dispatchPointerEvent(PointerState& state, const WebPointerEvent&); |
| 41 bool dispatchClickEvent(Node& capturingTarget, const WebPointerEvent&); | 47 bool dispatchClickEvent(Node& capturingTarget, const WebPointerEvent&); |
| 42 bool dispatchKeyboardEvent(Node& target, const WebKeyboardEvent& event); | 48 bool dispatchKeyboardEvent(Node& target, const WebKeyboardEvent& event); |
| 43 bool dispatchWheelEvent(Node& target, const WebWheelEvent& event); | 49 bool dispatchWheelEvent(Node& target, const WebWheelEvent& event); |
| 44 | 50 |
| 45 Node* targetForKeyboardEvent() const; | 51 Node* targetForKeyboardEvent() const; |
| 46 Node* targetForHitTestResult(const HitTestResult& hitTestResult); | 52 Node* targetForHitTestResult(const HitTestResult& hitTestResult); |
| 47 HitTestResult performHitTest(const LayoutPoint&); | 53 HitTestResult performHitTest(const LayoutPoint&); |
| 48 void updateSelectionForPointerDown(const HitTestResult&, const WebPointerEve
nt&); | 54 void updateSelectionForPointerDown(const HitTestResult&, const WebPointerEve
nt&); |
| 49 | 55 |
| 50 typedef std::map<int, RefPtr<Node>> PointerTargetMap; | 56 typedef std::map<int, PointerState> PointerStateMap; |
| 51 | 57 |
| 52 LocalFrame& m_frame; | 58 LocalFrame& m_frame; |
| 53 PointerTargetMap m_targetForPointer; | 59 PointerStateMap m_stateForPointer; |
| 54 bool m_suppressNextCharEvent; | 60 bool m_suppressNextCharEvent; |
| 55 }; | 61 }; |
| 56 | 62 |
| 57 } | 63 } |
| 58 | 64 |
| 59 #endif // SKY_ENGINE_CORE_FRAME_NEWEVENTHANDLER_H_ | 65 #endif // SKY_ENGINE_CORE_FRAME_NEWEVENTHANDLER_H_ |
| OLD | NEW |