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" |
11 #include "sky/engine/core/rendering/HitTestResult.h" | 11 #include "sky/engine/core/rendering/HitTestResult.h" |
12 #include "sky/engine/wtf/HashMap.h" | 12 #include "sky/engine/wtf/HashMap.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 class LocalFrame; | 16 class LocalFrame; |
17 class WebGestureEvent; | 17 class WebGestureEvent; |
| 18 class WebKeyboardEvent; |
18 class WebPointerEvent; | 19 class WebPointerEvent; |
19 | 20 |
20 class NewEventHandler { | 21 class NewEventHandler { |
21 WTF_MAKE_NONCOPYABLE(NewEventHandler); | 22 WTF_MAKE_NONCOPYABLE(NewEventHandler); |
22 public: | 23 public: |
23 explicit NewEventHandler(LocalFrame&); | 24 explicit NewEventHandler(LocalFrame&); |
24 ~NewEventHandler(); | 25 ~NewEventHandler(); |
25 | 26 |
26 bool handlePointerEvent(const WebPointerEvent&); | 27 bool handlePointerEvent(const WebPointerEvent&); |
27 bool handleGestureEvent(const WebGestureEvent&); | 28 bool handleGestureEvent(const WebGestureEvent&); |
| 29 bool handleKeyboardEvent(const WebKeyboardEvent&); |
28 | 30 |
29 private: | 31 private: |
30 bool handlePointerDownEvent(const WebPointerEvent&); | 32 bool handlePointerDownEvent(const WebPointerEvent&); |
31 bool handlePointerUpEvent(const WebPointerEvent&); | 33 bool handlePointerUpEvent(const WebPointerEvent&); |
32 bool handlePointerMoveEvent(const WebPointerEvent&); | 34 bool handlePointerMoveEvent(const WebPointerEvent&); |
33 bool handlePointerCancelEvent(const WebPointerEvent&); | 35 bool handlePointerCancelEvent(const WebPointerEvent&); |
34 | 36 |
35 bool dispatchGestureEvent(Node& target, const WebGestureEvent& event); | 37 bool dispatchGestureEvent(Node& target, const WebGestureEvent& event); |
36 bool dispatchPointerEvent(Node& target, const WebPointerEvent&); | 38 bool dispatchPointerEvent(Node& target, const WebPointerEvent&); |
37 bool dispatchClickEvent(Node& capturingTarget, const WebPointerEvent&); | 39 bool dispatchClickEvent(Node& capturingTarget, const WebPointerEvent&); |
| 40 bool dispatchKeyboardEvent(Node& target, const WebKeyboardEvent& event); |
38 | 41 |
| 42 Node* targetForKeyboardEvent() const; |
39 Node* targetForHitTestResult(const HitTestResult& hitTestResult); | 43 Node* targetForHitTestResult(const HitTestResult& hitTestResult); |
40 HitTestResult performHitTest(const LayoutPoint&); | 44 HitTestResult performHitTest(const LayoutPoint&); |
41 void updateSelectionForPointerDown(const HitTestResult&, const WebPointerEve
nt&); | 45 void updateSelectionForPointerDown(const HitTestResult&, const WebPointerEve
nt&); |
42 | 46 |
43 typedef std::map<int, RefPtr<Node>> PointerTargetMap; | 47 typedef std::map<int, RefPtr<Node>> PointerTargetMap; |
44 | 48 |
45 LocalFrame& m_frame; | 49 LocalFrame& m_frame; |
46 PointerTargetMap m_targetForPointer; | 50 PointerTargetMap m_targetForPointer; |
| 51 bool m_suppressNextCharEvent; |
47 }; | 52 }; |
48 | 53 |
49 } | 54 } |
50 | 55 |
51 #endif // SKY_ENGINE_CORE_FRAME_NEWEVENTHANDLER_H_ | 56 #endif // SKY_ENGINE_CORE_FRAME_NEWEVENTHANDLER_H_ |
OLD | NEW |