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

Side by Side Diff: third_party/WebKit/Source/core/events/InputEvent.h

Issue 2022863002: [InputEvent] Introduce |StaticRange| and use in |InputEvent::getRanges()| (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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 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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/StaticRangeTest.cpp ('k') | third_party/WebKit/Source/core/events/InputEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698