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

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: Android 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
« no previous file with comments | « chrome/browser/ui/toolbar/toolbar_model_unittest.cc ('k') | chrome/common/search/search_types.h » ('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
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
index a04bcafc058b74f793bff3140d51f775564e8c1d..d9b6d2aaf77c27da4d9fbe11231fc752a486974b 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -697,16 +697,12 @@ 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()) {
- // Select all in the reverse direction so as not to scroll the caret
- // into view and shift the contents jarringly.
- SelectAll(true);
- }
+ // When the user has clicked and released to give us focus, select all.
+ if ((event.IsOnlyLeftMouseButton() || event.IsOnlyRightMouseButton()) &&
+ 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);
}
select_all_on_mouse_release_ = false;
}
@@ -884,8 +880,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);
}
« no previous file with comments | « chrome/browser/ui/toolbar/toolbar_model_unittest.cc ('k') | chrome/common/search/search_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698