Chromium Code Reviews| Index: third_party/WebKit/Source/core/page/DragController.cpp |
| diff --git a/third_party/WebKit/Source/core/page/DragController.cpp b/third_party/WebKit/Source/core/page/DragController.cpp |
| index cd5db69054923e406dfdbe8d4f841baababf622c..060aa6dd54b2c2838f84ad717ca28db063a2692a 100644 |
| --- a/third_party/WebKit/Source/core/page/DragController.cpp |
| +++ b/third_party/WebKit/Source/core/page/DragController.cpp |
| @@ -42,8 +42,6 @@ |
| #include "core/editing/EditingUtilities.h" |
| #include "core/editing/Editor.h" |
| #include "core/editing/FrameSelection.h" |
| -#include "core/editing/commands/MoveSelectionCommand.h" |
| -#include "core/editing/commands/ReplaceSelectionCommand.h" |
| #include "core/editing/serializers/Serialization.h" |
| #include "core/events/TextEvent.h" |
| #include "core/fetch/ImageResource.h" |
| @@ -503,16 +501,11 @@ bool DragController::concludeEditDrag(DragData* dragData) |
| // but only to smart insert if the selection granularity is word granularity. |
| bool smartDelete = innerFrame->editor().smartInsertDeleteEnabled(); |
| bool smartInsert = smartDelete && innerFrame->selection().granularity() == WordGranularity && dragData->canSmartReplace(); |
| - MoveSelectionCommand::create(fragment, dragCaret.base(), smartInsert, smartDelete)->apply(); |
| + innerFrame->editor().moveSelectionAfterDragging(fragment, dragCaret.base(), smartInsert, smartDelete); |
| } else { |
| if (setSelectionToDragCaret(innerFrame.get(), dragCaret, range, point)) { |
| - ReplaceSelectionCommand::CommandOptions options = ReplaceSelectionCommand::SelectReplacement | ReplaceSelectionCommand::PreventNesting; |
| - if (dragData->canSmartReplace()) |
| - options |= ReplaceSelectionCommand::SmartReplace; |
| - if (chosePlainText) |
| - options |= ReplaceSelectionCommand::MatchStyle; |
| ASSERT(m_documentUnderMouse); |
| - ReplaceSelectionCommand::create(*m_documentUnderMouse.get(), fragment, options, EditActionDrag)->apply(); |
| + m_documentUnderMouse->frame()->editor().replaceSelectionAfterDragging(fragment, dragData->canSmartReplace(), chosePlainText); |
| } |
| } |
| } else { |
| @@ -522,7 +515,7 @@ bool DragController::concludeEditDrag(DragData* dragData) |
| if (setSelectionToDragCaret(innerFrame.get(), dragCaret, range, point)) { |
| ASSERT(m_documentUnderMouse); |
| - ReplaceSelectionCommand::create(*m_documentUnderMouse.get(), createFragmentFromText(EphemeralRange(range.get()), text), ReplaceSelectionCommand::SelectReplacement | ReplaceSelectionCommand::MatchStyle | ReplaceSelectionCommand::PreventNesting, EditActionDrag)->apply(); |
| + m_documentUnderMouse->frame()->editor().replaceSelectionAfterDragging(createFragmentFromText(EphemeralRange(range.get()), text), false, true); |
|
yosin_UTC9
2016/01/27 02:23:03
nit: please use const local variable to name param
Xiaocheng
2016/01/27 03:16:02
Done.
|
| } |
| } |