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

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, 9 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..b39ce44e6d44c5ef974bd9116e1e9cebdaae5ef0 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();
}
+
+ // Focus changes can affect the visibility of any keyword hint.
+ if (model()->is_keyword_hint())
+ location_bar_view_->Layout();
}
void OmniboxViewViews::OnBlur() {
@@ -799,6 +803,10 @@ void OmniboxViewViews::OnBlur() {
// Make sure the beginning of the text is visible.
SelectRange(gfx::Range(0));
+ // Focus changes can affect the visibility of any keyword hint.
+ if (model()->is_keyword_hint())
+ location_bar_view_->Layout();
+
// The location bar needs to repaint without a focus ring.
location_bar_view_->SchedulePaint();
}
« 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