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

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

Issue 2373773002: Fix a bug that viewed Omnibox hint when hint loses focus (Closed)
Patch Set: Revise code indentation and add comment Created 4 years, 3 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 e8754b5909bb2feddc4af1033649637bc021f4cb..0f2a27e8daf32396dc31d3ee3ce99e903e94e1f1 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -637,14 +637,15 @@ void LocationBarView::Layout() {
}
// Because IMEs may eat the tab key, we don't show "press tab to search" while
// IME composition is in progress.
- if (!keyword.empty() && omnibox_view_->model()->is_keyword_hint() &&
- !omnibox_view_->IsImeComposing()) {
- trailing_decorations.AddDecoration(vertical_padding, location_height, true,
- 0, item_padding, item_padding,
- keyword_hint_view_);
- if (keyword_hint_view_->keyword() != keyword)
- keyword_hint_view_->SetKeyword(keyword);
+ if (HasFocus() && !keyword.empty() && omnibox_view_->model()->is_keyword_hint() &&
Peter Kasting 2016/09/30 22:47:26 80 columns
+ !omnibox_view_->IsImeComposing()) {
Peter Kasting 2016/09/30 22:47:26 Spaces, not tabs
+ trailing_decorations.AddDecoration(vertical_padding, location_height, true,
+ 0, item_padding, item_padding,
+ keyword_hint_view_);
+ if (keyword_hint_view_->keyword() != keyword)
Peter Kasting 2016/09/30 22:47:26 Do not add trailing space
+ keyword_hint_view_->SetKeyword(keyword);
}
+
Peter Kasting 2016/09/30 22:47:26 Do not add second blank line
// Perform layout.
int full_width = width() - (2 * edge_thickness);

Powered by Google App Engine
This is Rietveld 408576698