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

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: 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/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 c9cf7111b946dbc0c44ac718eed6eca6bb15480c..194d915cccbc04cf70ee057924b2f9cfc530ecc9 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -128,7 +128,7 @@ OmniboxViewViews::OmniboxViewViews(OmniboxEditController* controller,
ime_candidate_window_open_(false),
select_all_on_mouse_release_(false),
select_all_on_gesture_tap_(false),
- weak_ptr_factory_(this) {
+ weak_ptr_factory_(this){
Peter Kasting 2016/09/30 22:47:26 Do not remove space
SetBorder(views::Border::NullBorder());
set_id(VIEW_ID_OMNIBOX);
SetFontList(font_list);
@@ -766,6 +766,10 @@ void OmniboxViewViews::OnFocus() {
SelectRange(saved_selection_for_focus_change_);
saved_selection_for_focus_change_ = gfx::Range::InvalidRange();
}
+
+ // Re-focusing, hint is visible
+ if (model()->is_keyword_hint())
+ location_bar_view_->Layout();
Peter Kasting 2016/09/30 22:47:26 Why make these calls here and not in the LocationB
}
void OmniboxViewViews::OnBlur() {
@@ -794,6 +798,10 @@ void OmniboxViewViews::OnBlur() {
// The location bar needs to repaint without a focus ring.
if (ui::MaterialDesignController::IsModeMaterial())
location_bar_view_->SchedulePaint();
+
+ // Hint is being visible. If losing focus, hint is invisible.
+ if (model()->is_keyword_hint())
+ location_bar_view_->Layout();
}
bool OmniboxViewViews::IsCommandIdEnabled(int command_id) const {

Powered by Google App Engine
This is Rietveld 408576698