Commit e15ff1b5 authored by xiaochengh's avatar xiaochengh Committed by Commit bot

Prune ComputeVisibleSelectionInDOMTree from Editor::Cut/Copy/Paste

This patch prunes some call sites of the deprecated function to improve
code health. The change is safe because layout has been updated a few
lines before each call site.

BUG=698633
TEST=n/a; no behavioral change

Review-Url: https://codereview.chromium.org/2847813005
Cr-Commit-Position: refs/heads/master@{#468277}
parent 0b70e87e
......@@ -1145,7 +1145,7 @@ void Editor::Cut(EditorCommandSource source) {
GetSpellChecker().UpdateMarkersForWordsAffectedByEditing(true);
if (EnclosingTextControl(GetFrame()
.Selection()
.ComputeVisibleSelectionInDOMTreeDeprecated()
.ComputeVisibleSelectionInDOMTree()
.Start())) {
String plain_text = GetFrame().SelectedTextForClipboard();
Pasteboard::GeneralPasteboard()->WritePlainText(
......@@ -1183,10 +1183,8 @@ void Editor::Copy() {
// we need clean layout to obtain the selected content.
GetFrame().GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets();
if (EnclosingTextControl(GetFrame()
.Selection()
.ComputeVisibleSelectionInDOMTreeDeprecated()
.Start())) {
if (EnclosingTextControl(
GetFrame().Selection().ComputeVisibleSelectionInDOMTree().Start())) {
Pasteboard::GeneralPasteboard()->WritePlainText(
GetFrame().SelectedTextForClipboard(),
CanSmartCopyOrDelete() ? Pasteboard::kCanSmartReplace
......@@ -1214,7 +1212,7 @@ void Editor::Paste(EditorCommandSource source) {
PasteMode paste_mode = GetFrame()
.Selection()
.ComputeVisibleSelectionInDOMTreeDeprecated()
.ComputeVisibleSelectionInDOMTree()
.IsContentRichlyEditable()
? kAllMimeTypes
: kPlainTextOnly;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment