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}
static bool isCaretAtStartOfWrappedLine(const FrameSelection& selection) {
  if (!selection.computeVisibleSelectionInDOMTreeDeprecated().isCaret())
    return false;
  if (selection.selectionInDOMTree().affinity() != TextAffinity::Downstream)
    return false;
  const Position& position =
      selection.computeVisibleSelectionInDOMTreeDeprecated().start();
  return !inSameLine(PositionWithAffinity(position, TextAffinity::Upstream),
                     PositionWithAffinity(position, TextAffinity::Downstream));
}

static bool isCaretAtStartOfWrappedLine(const FrameSelection& selection) {
  if (!selection.computeVisibleSelectionInDOMTreeDeprecated().isCaret())
    return false;
  if (selection.selectionInDOMTree().affinity() != TextAffinity::Downstream)
    return false;
  const Position& position =
      selection.computeVisibleSelectionInDOMTreeDeprecated().start();
  return !inSameLine(PositionWithAffinity(position, TextAffinity::Upstream),
                     PositionWithAffinity(position, TextAffinity::Downstream));
}
