OLD | NEW |
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 InputEvent_h | 5 #ifndef InputEvent_h |
6 #define InputEvent_h | 6 #define InputEvent_h |
7 | 7 |
| 8 #include "core/dom/StaticRange.h" |
8 #include "core/events/InputEventInit.h" | 9 #include "core/events/InputEventInit.h" |
9 #include "core/events/UIEvent.h" | 10 #include "core/events/UIEvent.h" |
10 | 11 |
11 namespace blink { | 12 namespace blink { |
12 | 13 |
13 class Range; | |
14 | |
15 class InputEvent final : public UIEvent { | 14 class InputEvent final : public UIEvent { |
16 DEFINE_WRAPPERTYPEINFO(); | 15 DEFINE_WRAPPERTYPEINFO(); |
17 | 16 |
18 public: | 17 public: |
19 static InputEvent* create() | 18 static InputEvent* create() |
20 { | 19 { |
21 return new InputEvent; | 20 return new InputEvent; |
22 } | 21 } |
23 | 22 |
24 static InputEvent* create(const AtomicString& type, const InputEventInit& in
itializer) | 23 static InputEvent* create(const AtomicString& type, const InputEventInit& in
itializer) |
(...skipping 24 matching lines...) Expand all Loading... |
49 IsComposing = true, | 48 IsComposing = true, |
50 }; | 49 }; |
51 | 50 |
52 static InputEvent* createBeforeInput(InputType, const String& data, EventCan
celable, EventIsComposing, const RangeVector*); | 51 static InputEvent* createBeforeInput(InputType, const String& data, EventCan
celable, EventIsComposing, const RangeVector*); |
53 | 52 |
54 String inputType() const; | 53 String inputType() const; |
55 const String& data() const { return m_data; } | 54 const String& data() const { return m_data; } |
56 bool isComposing() const { return m_isComposing; } | 55 bool isComposing() const { return m_isComposing; } |
57 // Returns a copy of target ranges during event dispatch, and returns an emp
ty | 56 // Returns a copy of target ranges during event dispatch, and returns an emp
ty |
58 // vector after dispatch. | 57 // vector after dispatch. |
59 // TODO(chongz): Return Vector<StaticRange>. | 58 StaticRangeVector getRanges() const; |
60 HeapVector<Member<Range>> getRanges() const { return m_ranges; }; | |
61 | 59 |
62 bool isInputEvent() const override; | 60 bool isInputEvent() const override; |
63 | 61 |
64 EventDispatchMediator* createMediator() override; | 62 EventDispatchMediator* createMediator() override; |
65 | 63 |
66 DECLARE_VIRTUAL_TRACE(); | 64 DECLARE_VIRTUAL_TRACE(); |
67 | 65 |
68 private: | 66 private: |
69 friend class InputEventDispatchMediator; | 67 friend class InputEventDispatchMediator; |
70 InputEvent(); | 68 InputEvent(); |
(...skipping 15 matching lines...) Expand all Loading... |
86 explicit InputEventDispatchMediator(InputEvent*); | 84 explicit InputEventDispatchMediator(InputEvent*); |
87 InputEvent& event() const; | 85 InputEvent& event() const; |
88 DispatchEventResult dispatchEvent(EventDispatcher&) const override; | 86 DispatchEventResult dispatchEvent(EventDispatcher&) const override; |
89 }; | 87 }; |
90 | 88 |
91 DEFINE_EVENT_TYPE_CASTS(InputEvent); | 89 DEFINE_EVENT_TYPE_CASTS(InputEvent); |
92 | 90 |
93 } // namespace blink | 91 } // namespace blink |
94 | 92 |
95 #endif // InputEvent_h | 93 #endif // InputEvent_h |
OLD | NEW |