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

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

Issue 2232863002: Remove search::GetSearchTerms since it always returns empty string (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_query_extract
Patch Set: Mac Created 4 years, 4 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
Index: chrome/browser/ui/views/omnibox/omnibox_view_views.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
index a04bcafc058b74f793bff3140d51f775564e8c1d..b7f3c466c2badf0e3e9555ddb3857e193055424d 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -698,11 +698,8 @@ bool OmniboxViewViews::OnMouseDragged(const ui::MouseEvent& event) {
void OmniboxViewViews::OnMouseReleased(const ui::MouseEvent& event) {
views::Textfield::OnMouseReleased(event);
if (event.IsOnlyLeftMouseButton() || event.IsOnlyRightMouseButton()) {
- // When the user has clicked and released to give us focus, select all
- // unless we're omitting the URL (in which case refining an existing query
- // is common enough that we do click-to-place-cursor).
- if (select_all_on_mouse_release_ &&
- !controller()->GetToolbarModel()->WouldReplaceURL()) {
+ // When the user has clicked and released to give us focus, select all.
Peter Kasting 2016/08/13 05:03:44 Nit: Move this comment above the line above, and t
Marc Treib 2016/08/16 12:00:17 Done.
+ if (select_all_on_mouse_release_) {
// Select all in the reverse direction so as not to scroll the caret
// into view and shift the contents jarringly.
SelectAll(true);
@@ -884,8 +881,9 @@ bool OmniboxViewViews::IsCommandIdEnabled(int command_id) const {
return !read_only() && !GetClipboardText().empty();
if (command_id == IDS_PASTE_AND_GO)
return !read_only() && model()->CanPasteAndGo(GetClipboardText());
+ // TODO(treib): Completely remove IDS_SHOW_URL. crbug.com/627747
if (command_id == IDS_SHOW_URL)
- return controller()->GetToolbarModel()->WouldReplaceURL();
+ return false;
return Textfield::IsCommandIdEnabled(command_id) ||
location_bar_view_->command_updater()->IsCommandEnabled(command_id);
}

Powered by Google App Engine
This is Rietveld 408576698