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

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 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..4c14550f401bf7dfdfdceeed9d0c620cd9115c8a 100644
--- a/third_party/WebKit/Source/core/events/InputEvent.h
+++ b/third_party/WebKit/Source/core/events/InputEvent.h
@@ -24,6 +24,29 @@ 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,
+ };
+
+ enum EventCancelable : bool {
+ NotCancelable = false,
+ IsCancelable = true,
+ };
+
+ static InputEvent* createBeforeInput(InputType, const String& data, EventCancelable);
+
+ String inputType() const;
+ const String& data() const { return m_data; }
+
bool isInputEvent() const override;
DECLARE_VIRTUAL_TRACE();
@@ -31,6 +54,9 @@ public:
private:
InputEvent();
InputEvent(const AtomicString&, const InputEventInit&);
+
+ InputType m_inputType;
+ String m_data;
};
DEFINE_EVENT_TYPE_CASTS(InputEvent);
« 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