Make TypingCommand::insertText() to take SelectionInDOMTree instead of VisibleSelection

This patch makes |TypingCommand::insertText()| to take |SelectionInDOMTree|
instead of |VisibleSelection| to reduce usage of |VisibleSelection| for
improving code health.

BUG=657237
TEST=n/a

Review-Url: https://codereview.chromium.org/2733183002
Cr-Commit-Position: refs/heads/master@{#455368}
void Editor::copy() {
  if (tryDHTMLCopy())
    return;  // DHTML did the whole operation
  if (!canCopy())
    return;

  frame().document()->updateStyleAndLayoutIgnorePendingStylesheets();

  if (enclosingTextControl(frame()
                               .selection()
                               .computeVisibleSelectionInDOMTreeDeprecated()
                               .start())) {
    Pasteboard::generalPasteboard()->writePlainText(
        frame().selectedTextForClipboard(),
        canSmartCopyOrDelete() ? Pasteboard::CanSmartReplace
                               : Pasteboard::CannotSmartReplace);
  } else {
    Document* document = frame().document();
    if (HTMLImageElement* imageElement =
            imageElementFromImageDocument(document))
      writeImageNodeToPasteboard(Pasteboard::generalPasteboard(), imageElement,
                                 document->title());
    else
      writeSelectionToPasteboard();
  }
}

void Editor::copy() {
  if (tryDHTMLCopy())
    return;  // DHTML did the whole operation
  if (!canCopy())
    return;

  frame().document()->updateStyleAndLayoutIgnorePendingStylesheets();

  if (enclosingTextControl(frame()
                               .selection()
                               .computeVisibleSelectionInDOMTreeDeprecated()
                               .start())) {
    Pasteboard::generalPasteboard()->writePlainText(
        frame().selectedTextForClipboard(),
        canSmartCopyOrDelete() ? Pasteboard::CanSmartReplace
                               : Pasteboard::CannotSmartReplace);
  } else {
    Document* document = frame().document();
    if (HTMLImageElement* imageElement =
            imageElementFromImageDocument(document))
      writeImageNodeToPasteboard(Pasteboard::generalPasteboard(), imageElement,
                                 document->title());
    else
      writeSelectionToPasteboard();
  }
}
