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

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

Issue 2258663003: [InputEvent] Support |deleteByCut|&|insertFromPaste| with |dataTransfer| field (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Support cut/paste with |dataTransfer| field and correct event order Created 4 years, 4 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/EditorCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
index 1b3f1a50e1d49a7acc1344a376b70375e3217020..0a94b5e1375449d442ba65e8fcfc983058660b71 100644
--- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
@@ -160,12 +160,7 @@ InputEvent::InputType InputTypeFromCommandType(WebEditingCommandType commandType
return InputType::Undo;
case CommandType::Redo:
return InputType::Redo;
- case CommandType::Copy:
- return InputType::Copy;
- case CommandType::Cut:
- return InputType::Cut;
- case CommandType::Paste:
- return InputType::Paste;
+ // Cut and Paste will be handled in |Editor::dispatchCPPEvent()|.
// Styling.
case CommandType::Bold:
@@ -467,7 +462,7 @@ static bool executeCut(LocalFrame& frame, Event*, EditorCommandSource source, co
// |canExecute()|. See also "Copy", and "Paste" command.
if (!canWriteClipboard(frame, source))
return false;
- frame.editor().cut();
+ frame.editor().cut(source);
return true;
}
@@ -1114,7 +1109,7 @@ static bool executePaste(LocalFrame& frame, Event*, EditorCommandSource source,
// |canExecute()|. See also "Copy", and "Cut" command.
if (!canReadClipboard(frame, source))
return false;
- frame.editor().paste();
+ frame.editor().paste(source);
return true;
}
@@ -1133,14 +1128,14 @@ static bool executePasteGlobalSelection(LocalFrame& frame, Event*, EditorCommand
bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode();
Pasteboard::generalPasteboard()->setSelectionMode(true);
- frame.editor().paste();
+ frame.editor().paste(source);
Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode);
return true;
}
-static bool executePasteAndMatchStyle(LocalFrame& frame, Event*, EditorCommandSource, const String&)
+static bool executePasteAndMatchStyle(LocalFrame& frame, Event*, EditorCommandSource source, const String&)
{
- frame.editor().pasteAsPlainText();
+ frame.editor().pasteAsPlainText(source);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698