Commit d92af9fd authored by msw@chromium.org's avatar msw@chromium.org

Views Omnibox: Only select all on update with previous selection.

BUG=343852
TEST=With a clear selection clipboard on Linux Aura; type "chrome://apps"+[ENTER]; open a new tab and middle click in the empty omnibox; no text should be pasted. No selection/update or other Omnibox behavior regressions.
R=pkasting@chromium.org

Review URL: https://codereview.chromium.org/164753008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251516 0039d316-1c4b-4281-b951-d872f2087c98
parent d362e89c
......@@ -494,8 +494,8 @@ void OmniboxViewViews::Update() {
// change it right before the permanent URL is changed. Since the new URL
// is still fully selected, the user's typing will replace the edit contents
// as they'd intended.
const gfx::Range range(GetSelectedRange());
const bool was_select_all = (range.length() == text().length());
const bool was_select_all = !text().empty() && IsSelectAll();
const bool was_reversed = GetSelectedRange().is_reversed();
RevertAll();
......@@ -508,7 +508,7 @@ void OmniboxViewViews::Update() {
// and address cases like this, but it seems better to just not muck with
// things when the omnibox isn't focused to begin with.
if (was_select_all && model()->has_focus())
SelectAll(range.is_reversed());
SelectAll(was_reversed);
} else if (old_security_level != security_level_) {
EmphasizeURLComponents();
}
......
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