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

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

Issue 2373773002: Fix a bug that viewed Omnibox hint when hint loses focus (Closed)
Patch Set: Fixed a bug that viewed Omnibox hint when hint loses focus Created 3 years, 10 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/views/location_bar/location_bar_view.cc ('k') | no next file » | 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 0f22b6ee6e9593c66759e2e7ab82f406c59e5b0f..c59c552599b666186a26238a7008e7060286eb8b 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -774,6 +774,10 @@ void OmniboxViewViews::OnFocus() {
SelectRange(saved_selection_for_focus_change_);
saved_selection_for_focus_change_ = gfx::Range::InvalidRange();
}
+
+ // Re-focusing, keyword hint is visible.
+ if (model()->is_keyword_hint())
+ location_bar_view_->Layout();
}
void OmniboxViewViews::OnBlur() {
@@ -801,6 +805,10 @@ void OmniboxViewViews::OnBlur() {
// The location bar needs to repaint without a focus ring.
location_bar_view_->SchedulePaint();
+
+ // Hint is being visible. If losing focus, Keyword hint is invisible.
Peter Kasting 2017/02/25 05:23:09 Nit: I would say "Focus changes can affect the vis
+ if (model()->is_keyword_hint())
+ location_bar_view_->Layout();
Peter Kasting 2017/02/25 05:23:09 This block should go above the SchedulePaint() cal
}
bool OmniboxViewViews::IsCommandIdEnabled(int command_id) const {
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698