Chromium Code Reviews| 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(); |