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

Unified Diff: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm

Issue 2381373003: Fixed the issue shows keyword hint when omnibox loses its focus. (Closed)
Patch Set: 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/cocoa/location_bar/location_bar_view_mac.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
index 0baec69b671abc3f7f965f1a9a33220de800f46d..b5828d60750bc6ef129e215d6c749050b51f0aa4 100644
--- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
+++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
@@ -495,7 +495,9 @@ void LocationBarViewMac::Layout() {
selected_keyword_decoration_->SetImage(GetKeywordImage(keyword));
} else if (!keyword.empty() && is_keyword_hint) {
keyword_hint_decoration_->SetKeyword(short_name, is_extension_keyword);
- keyword_hint_decoration_->SetVisible(true);
+ if (focus_state_ == OMNIBOX_FOCUS_VISIBLE) {
+ keyword_hint_decoration_->SetVisible(true);
+ }
} else if (ShouldShowEVBubble()) {
// Switch from location icon to show the EV bubble instead.
location_icon_decoration_->SetVisible(false);
@@ -684,6 +686,12 @@ WebContents* LocationBarViewMac::GetWebContents() {
return browser_->tab_strip_model()->GetActiveWebContents();
}
+void LocationBarViewMac::OnFocusChanged(OmniboxFocusState state) {
+ focus_state_ = state;
+
+ Layout();
+}
+
bool LocationBarViewMac::ShouldShowEVBubble() const {
return (GetToolbarModel()->GetSecurityLevel(false) ==
security_state::SecurityStateModel::EV_SECURE) &&
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h ('k') | chrome/browser/ui/omnibox/chrome_omnibox_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698