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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 2792103005: Make keyword hint view ("press tab to search foo.com") clickable. (Closed)
Patch Set: elaborate on comment Created 3 years, 8 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/location_bar/location_bar_view.cc
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index bb7929e84c17c95c4d30ce892b8e413b889574d9..5536a492e6f6f98592530eaa5fab5081a90c4c40 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -213,7 +213,7 @@ void LocationBarView::Init() {
gfx::FontList bubble_font_list =
font_list.DeriveWithHeightUpperBound(bubble_height);
keyword_hint_view_ = new KeywordHintView(
- profile(), font_list, bubble_font_list, location_height,
+ this, profile(), font_list, bubble_font_list, location_height,
GetColor(LocationBarView::DEEMPHASIZED_TEXT), background_color);
AddChildView(keyword_hint_view_);
@@ -709,6 +709,15 @@ void LocationBarView::OnDefaultZoomLevelChanged() {
RefreshZoomView();
}
+void LocationBarView::ButtonPressed(views::Button* sender,
+ const ui::Event& event) {
+ DCHECK_EQ(keyword_hint_view_, sender);
+ DCHECK(event.IsMouseEvent() || event.IsGestureEvent());
+ omnibox_view_->model()->AcceptKeyword(
+ event.IsMouseEvent() ? KeywordModeEntryMethod::CLICK_ON_VIEW
+ : KeywordModeEntryMethod::TAP_ON_VIEW);
+}
+
bool LocationBarView::RefreshSaveCreditCardIconView() {
WebContents* web_contents = GetWebContents();
if (!web_contents)
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.h ('k') | components/omnibox/browser/omnibox_edit_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698