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

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

Issue 1752933002: [InputEvent] Fire 'beforeinput' during typing, pressing hot keys and IME composition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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/events/InputEventInit.h" 8 #include "core/events/InputEventInit.h"
9 #include "core/events/UIEvent.h" 9 #include "core/events/UIEvent.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 class InputEvent final : public UIEvent { 13 class InputEvent final : public UIEvent {
14 DEFINE_WRAPPERTYPEINFO(); 14 DEFINE_WRAPPERTYPEINFO();
15 15
16 public: 16 public:
17 static InputEvent* create() 17 static InputEvent* create()
18 { 18 {
19 return new InputEvent; 19 return new InputEvent;
20 } 20 }
21 21
22 static InputEvent* create(const AtomicString& type, const InputEventInit& in itializer) 22 static InputEvent* create(const AtomicString& type, const InputEventInit& in itializer)
23 { 23 {
24 return new InputEvent(type, initializer); 24 return new InputEvent(type, initializer);
25 } 25 }
26 26
27 enum class InputType {
28 None,
29 InsertText,
30 ReplaceContent,
31 DeleteContent,
32 DeleteComposedCharacter,
33 Undo,
34 Redo,
35
36 // Add new input types immediately above this line.
37 NumberOfInputTypes,
38 };
39
40 enum EventCancelable : bool {
41 NotCancelable = false,
42 IsCancelable = true,
43 };
44
45 static InputEvent* createBeforeInput(InputType, const String& data, EventCan celable);
46
47 String inputType() const;
48 const String& data() const { return m_data; }
49
27 bool isInputEvent() const override; 50 bool isInputEvent() const override;
28 51
29 DECLARE_VIRTUAL_TRACE(); 52 DECLARE_VIRTUAL_TRACE();
30 53
31 private: 54 private:
32 InputEvent(); 55 InputEvent();
33 InputEvent(const AtomicString&, const InputEventInit&); 56 InputEvent(const AtomicString&, const InputEventInit&);
57
58 InputType m_inputType;
59 String m_data;
34 }; 60 };
35 61
36 DEFINE_EVENT_TYPE_CASTS(InputEvent); 62 DEFINE_EVENT_TYPE_CASTS(InputEvent);
37 63
38 } // namespace blink 64 } // namespace blink
39 65
40 #endif // InputEvent_h 66 #endif // InputEvent_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/EventTypeNames.in ('k') | third_party/WebKit/Source/core/events/InputEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698