Remove moveCursorToSelectionEnd()
moveCursorToSelectionEnd() blocks the IME thread unnecessarily, which causes
back navigation to fail. So this CL removes moveCursorToSelectionEnd() and
replaces with mWebContents.unselect().
In RenderFrameImpl::OnUnselect(), the cursor is deleted entirely, which causes
text boxes to be unfocused as a side effect. To fix that, this CL collapses the
selection to the selection end, and renames the functions to CollapseSelection().
BUG=697756
TEST=run_chrome_public_test_apk --test-filter TabsTest.testTabSwitcherCollapseSelection
Review-Url: https://codereview.chromium.org/2734943005
Cr-Commit-Position: refs/heads/master@{#455963}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 4b5645f..f8910b4 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2793,13 +2793,13 @@
RecordAction(base::UserMetricsAction("SelectAll"));
}
-void WebContentsImpl::Unselect() {
+void WebContentsImpl::CollapseSelection() {
RenderFrameHost* focused_frame = GetFocusedFrame();
if (!focused_frame)
return;
- focused_frame->Send(new InputMsg_Unselect(focused_frame->GetRoutingID()));
- RecordAction(base::UserMetricsAction("Unselect"));
+ focused_frame->Send(
+ new InputMsg_CollapseSelection(focused_frame->GetRoutingID()));
}
void WebContentsImpl::Replace(const base::string16& word) {