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) && |