Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4705)

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_view_views.cc

Issue 18292010: Merge 209839 "Don't mess with omnibox selection on update when t..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1547/src/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/omnibox/omnibox_view_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/omnibox/omnibox_view_views.cc
===================================================================
--- chrome/browser/ui/views/omnibox/omnibox_view_views.cc (revision 210454)
+++ chrome/browser/ui/views/omnibox/omnibox_view_views.cc (working copy)
@@ -390,7 +390,15 @@
RevertAll();
- if (was_select_all)
+ // Only select all when we have focus. If we don't have focus, selecting
+ // all is unnecessary since the selection will change on regaining focus,
+ // and can in fact cause artifacts, e.g. if the user is on the NTP and
+ // clicks a link to navigate, causing |was_select_all| to be vacuously true
+ // for the empty omnibox, and we then select all here, leading to the
+ // trailing portion of a long URL being scrolled into view. We could try
+ // 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());
} else if (changed_security_level) {
EmphasizeURLComponents();
« no previous file with comments | « no previous file | chrome/browser/ui/views/omnibox/omnibox_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698