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

Unified Diff: third_party/WebKit/Source/core/page/DragController.cpp

Issue 2374183004: Make non-null VisibleSelections creatable only by createVisibleSelection[Deprecated] (Closed)
Patch Set: Fix mac compile error Created 4 years, 3 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/page/DragController.cpp
diff --git a/third_party/WebKit/Source/core/page/DragController.cpp b/third_party/WebKit/Source/core/page/DragController.cpp
index 70e4290a77a1b481e6320b4fce4f54f1837486a4..c4f663c311f13cd3f2d08d5600757bbd32c92ae9 100644
--- a/third_party/WebKit/Source/core/page/DragController.cpp
+++ b/third_party/WebKit/Source/core/page/DragController.cpp
@@ -433,7 +433,7 @@ static bool setSelectionToDragCaret(LocalFrame* frame, VisibleSelection& dragCar
{
frame->selection().setSelection(dragCaret);
if (frame->selection().isNone()) {
- dragCaret = VisibleSelection(frame->positionForPoint(point));
+ dragCaret = createVisibleSelectionDeprecated(frame->positionForPoint(point));
frame->selection().setSelection(dragCaret);
range = createRange(dragCaret.toNormalizedEphemeralRange());
}
@@ -444,7 +444,7 @@ DispatchEventResult DragController::dispatchTextInputEventFor(LocalFrame* innerF
{
ASSERT(m_page->dragCaretController().hasCaret());
String text = m_page->dragCaretController().isContentRichlyEditable() ? "" : dragData->asPlainText();
- Element* target = innerFrame->editor().findEventTargetFrom(VisibleSelection(m_page->dragCaretController().caretPosition()));
+ Element* target = innerFrame->editor().findEventTargetFrom(createVisibleSelectionDeprecated(m_page->dragCaretController().caretPosition()));
return target->dispatchEvent(TextEvent::createForDrop(innerFrame->domWindow(), text));
}
@@ -486,7 +486,7 @@ bool DragController::concludeEditDrag(DragData* dragData)
return false;
}
- VisibleSelection dragCaret(m_page->dragCaretController().caretPosition());
+ VisibleSelection dragCaret = createVisibleSelectionDeprecated(m_page->dragCaretController().caretPosition());
m_page->dragCaretController().clear();
// |innerFrame| can be removed by event handler called by
// |dispatchTextInputEventFor()|.
@@ -722,7 +722,7 @@ static void prepareDataTransferForImageDrag(LocalFrame* source, DataTransfer* da
if (hasRichlyEditableStyle(*node)) {
Range* range = source->document()->createRange();
range->selectNode(node, ASSERT_NO_EXCEPTION);
- source->selection().setSelection(VisibleSelection(EphemeralRange(range)));
+ source->selection().setSelection(createVisibleSelectionDeprecated(EphemeralRange(range)));
}
dataTransfer->declareAndWriteDragImage(node, !linkURL.isEmpty() ? linkURL : imageURL, label);
}

Powered by Google App Engine
This is Rietveld 408576698