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

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

Issue 18543012: Don't mess with omnibox selection on update when the omnibox doesn't have focus. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 6 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 209724)
+++ chrome/browser/ui/views/omnibox/omnibox_view_views.cc (working copy)
@@ -390,7 +390,17 @@
RevertAll();
- if (was_select_all)
+ // When the old text was empty, we don't bother selecting the new text.
+ // You might think we could reach here if the user has deleted the previous
msw 2013/07/02 23:35:21 nit: Just explain the reasoning plainly: "Do not s
Peter Kasting 2013/07/02 23:38:45 Rendering jank isn't my concern, and the rest of t
msw 2013/07/03 00:04:07 Fine, but there's little reason to speculate about
+ // URL, but in that case the model will see that user input is in progress
+ // and return false from UpdatePermanentText() (so we won't reach here),
+ // unless we don't have focus, in which case we don't care anyway because
+ // re-focusing the omnibox will modify the selection regardless. The only
+ // time we actually reach here with empty text is when the user was on the
+ // NTP and clicked something on the page to navigate, in which case the
+ // omnibox shouldn't have focus anyway, and selecting all will at best do
msw 2013/07/03 00:04:07 The comment, "in which case the omnibox shouldn't
+ // nothing and at worst cause problems like reversing the URL.
msw 2013/07/03 00:04:07 The URL would not be reversed; the problem we obse
+ if (was_select_all && !range.is_empty())
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