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

Side by Side 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: 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 unified diff | Download patch
« no previous file with comments | « AUTHORS ('k') | chrome/browser/ui/views/omnibox/omnibox_view_views.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 9
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 content_setting_views_.rbegin()); i != content_setting_views_.rend(); 541 content_setting_views_.rbegin()); i != content_setting_views_.rend();
542 ++i) { 542 ++i) {
543 if ((*i)->visible()) { 543 if ((*i)->visible()) {
544 trailing_decorations.AddDecoration(vertical_padding, location_height, 544 trailing_decorations.AddDecoration(vertical_padding, location_height,
545 false, 0, item_padding, item_padding, 545 false, 0, item_padding, item_padding,
546 *i); 546 *i);
547 } 547 }
548 } 548 }
549 // Because IMEs may eat the tab key, we don't show "press tab to search" while 549 // Because IMEs may eat the tab key, we don't show "press tab to search" while
550 // IME composition is in progress. 550 // IME composition is in progress.
551 if (!keyword.empty() && omnibox_view_->model()->is_keyword_hint() && 551 if (HasFocus() && !keyword.empty() &&
552 omnibox_view_->model()->is_keyword_hint() &&
552 !omnibox_view_->IsImeComposing()) { 553 !omnibox_view_->IsImeComposing()) {
553 trailing_decorations.AddDecoration(vertical_padding, location_height, true, 554 trailing_decorations.AddDecoration(vertical_padding, location_height, true,
554 0, item_padding, item_padding, 555 0, item_padding, item_padding,
555 keyword_hint_view_); 556 keyword_hint_view_);
556 if (keyword_hint_view_->keyword() != keyword) 557 if (keyword_hint_view_->keyword() != keyword)
557 keyword_hint_view_->SetKeyword(keyword); 558 keyword_hint_view_->SetKeyword(keyword);
558 } 559 }
559 560
560 const int edge_thickness = GetHorizontalEdgeThickness(); 561 const int edge_thickness = GetHorizontalEdgeThickness();
561 562
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 // LocationBarView, private TemplateURLServiceObserver implementation: 1189 // LocationBarView, private TemplateURLServiceObserver implementation:
1189 1190
1190 void LocationBarView::OnTemplateURLServiceChanged() { 1191 void LocationBarView::OnTemplateURLServiceChanged() {
1191 template_url_service_->RemoveObserver(this); 1192 template_url_service_->RemoveObserver(this);
1192 template_url_service_ = nullptr; 1193 template_url_service_ = nullptr;
1193 // If the browser is no longer active, let's not show the info bubble, as this 1194 // If the browser is no longer active, let's not show the info bubble, as this
1194 // would make the browser the active window again. 1195 // would make the browser the active window again.
1195 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) 1196 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive())
1196 ShowFirstRunBubble(); 1197 ShowFirstRunBubble();
1197 } 1198 }
OLDNEW
« no previous file with comments | « AUTHORS ('k') | chrome/browser/ui/views/omnibox/omnibox_view_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698