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

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: Yosi's review Created 4 years, 9 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 f6c46ae58d23d1c655b4c72059353d8d97b9a273..7adcb269e5e765c22b32440c98f2df78edf5ea51 100644
--- a/third_party/WebKit/Source/core/events/InputEvent.h
+++ b/third_party/WebKit/Source/core/events/InputEvent.h
@@ -24,6 +24,18 @@ public:
return adoptRefWillBeNoop(new InputEvent(type, initializer));
}
+ enum class InputType {
+ InsertText,
+ ReplaceText,
+ };
+
+ static PassRefPtrWillBeRawPtr<InputEvent> createBeforeInputTyping(InputType, const String& data);
+ static PassRefPtrWillBeRawPtr<InputEvent> createBeforeInputCompositionUpdate(InputType, const String& data);
+ static PassRefPtrWillBeRawPtr<InputEvent> createBeforeInputEditorCommand(const String& commandName, const String& data);
+
+ const String& inputType() const { return m_inputType; }
+ const String& data() const { return m_data; }
+
bool isInputEvent() const override;
DECLARE_VIRTUAL_TRACE();
@@ -31,6 +43,9 @@ public:
private:
InputEvent();
InputEvent(const AtomicString&, const InputEventInit&);
+
+ String m_inputType;
+ String m_data;
};
DEFINE_EVENT_TYPE_CASTS(InputEvent);

Powered by Google App Engine
This is Rietveld 408576698