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

Unified 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 on WebEditingCommandType & Yosin's review 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/events/InputEvent.h
diff --git a/third_party/WebKit/Source/core/events/InputEvent.h b/third_party/WebKit/Source/core/events/InputEvent.h
index 8bfb45efe58379f7a6dbe1792045450897b70316..ed95254e59a15704d39961eff71d338ed128d411 100644
--- a/third_party/WebKit/Source/core/events/InputEvent.h
+++ b/third_party/WebKit/Source/core/events/InputEvent.h
@@ -24,6 +24,26 @@ public:
return new InputEvent(type, initializer);
}
+ enum class InputType {
+ None,
+ InsertText,
+ ReplaceContent,
+ DeleteContent,
+ DeleteComposedCharacter,
+ Undo,
+ Redo,
+
+ // Add new input types immediately above this line.
+ NumberOfInputTypes,
+ };
+
+ static InputEvent* createBeforeInputTyping(InputType, const String& data);
+ static InputEvent* createBeforeInputFromComposition(InputType, const String& data);
+ static InputEvent* createBeforeInputEditorCommand(InputType, const String& data);
+
+ String inputType() const;
+ const String& data() const { return m_data; }
+
bool isInputEvent() const override;
DECLARE_VIRTUAL_TRACE();
@@ -31,6 +51,9 @@ public:
private:
InputEvent();
InputEvent(const AtomicString&, const InputEventInit&);
+
+ InputType m_inputType;
chongz 2016/04/13 00:34:28 Changed to enum.
+ String m_data;
};
DEFINE_EVENT_TYPE_CASTS(InputEvent);

Powered by Google App Engine
This is Rietveld 408576698