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

Unified Diff: third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp

Issue 2738953003: [InputEvent] Support 'insertFromYank' for macOS (Closed)
Patch Set: yosin's review: Only implement yank Created 3 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/editing/commands/TypingCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
index ef00372c38e625714f559c15b72f23d87e4f5224..febcc9f3ec6000eec7b049c5c4f93251278e20b2 100644
--- a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
@@ -313,7 +313,8 @@ void TypingCommand::insertText(
const SelectionInDOMTree& passedSelectionForInsertion,
Options options,
TextCompositionType compositionType,
- const bool isIncrementalInsertion) {
+ const bool isIncrementalInsertion,
+ InputEvent::InputType inputType) {
LocalFrame* frame = document.frame();
DCHECK(frame);
@@ -363,6 +364,7 @@ void TypingCommand::insertText(
PreventSpellChecking);
lastTypingCommand->m_isIncrementalInsertion = isIncrementalInsertion;
lastTypingCommand->m_selectionStart = selectionStart;
+ lastTypingCommand->m_inputType = inputType;
EditingState editingState;
EventQueueScope eventQueueScope;
@@ -380,6 +382,7 @@ void TypingCommand::insertText(
}
command->m_isIncrementalInsertion = isIncrementalInsertion;
command->m_selectionStart = selectionStart;
+ command->m_inputType = inputType;
command->apply();
if (changeSelection) {
@@ -490,6 +493,9 @@ InputEvent::InputType TypingCommand::inputType() const {
if (m_compositionType != TextCompositionNone)
return InputType::InsertCompositionText;
+ if (m_inputType != InputType::None)
+ return m_inputType;
+
switch (m_commandType) {
// TODO(chongz): |DeleteSelection| is used by IME but we don't have
// direction info.
« no previous file with comments | « third_party/WebKit/Source/core/editing/commands/TypingCommand.h ('k') | third_party/WebKit/Source/core/events/InputEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698