| 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 581610865a5ec35042e4f47226f35a80df0036d1..5b221cc71373745af25677c6b57451872fd04005 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
|
| @@ -498,8 +498,9 @@ void LocationBarViewMac::Layout() {
|
| // displayed, even if the width is narrow.
|
| CGFloat available_width =
|
| [cell availableWidthInFrame:[[cell controlView] frame]];
|
| - is_width_available_for_security_verbose_ =
|
| - available_width >= kMinURLWidth || ShouldShowEVBubble();
|
| + is_width_available_for_security_verbose_ = available_width >= kMinURLWidth ||
|
| + ShouldShowEVBubble() ||
|
| + ShouldShowExtensionBubble();
|
|
|
| if (!keyword.empty() && !is_keyword_hint) {
|
| // Switch from location icon to keyword mode.
|
| @@ -522,6 +523,15 @@ void LocationBarViewMac::Layout() {
|
| base::string16 label(GetToolbarModel()->GetEVCertName());
|
| security_state_bubble_decoration_->SetFullLabel(
|
| base::SysUTF16ToNSString(label));
|
| + } else if (ShouldShowExtensionBubble()) {
|
| + // Switch from location icon to show the extension bubble instead.
|
| + location_icon_decoration_->SetVisible(false);
|
| + security_state_bubble_decoration_->SetVisible(true);
|
| +
|
| + base::string16 label(
|
| + GetExtensionName(GetToolbarModel()->GetURL(), GetWebContents()));
|
| + security_state_bubble_decoration_->SetFullLabel(
|
| + base::SysUTF16ToNSString(label));
|
| } else if (ShouldShowSecurityState() ||
|
| security_state_bubble_decoration_->AnimatingOut()) {
|
| bool is_security_state_visible =
|
| @@ -692,6 +702,10 @@ bool LocationBarViewMac::ShouldShowEVBubble() const {
|
| security_state::EV_SECURE;
|
| }
|
|
|
| +bool LocationBarViewMac::ShouldShowExtensionBubble() const {
|
| + return GetToolbarModel()->GetURL().SchemeIs(extensions::kExtensionScheme);
|
| +}
|
| +
|
| bool LocationBarViewMac::ShouldShowSecurityState() const {
|
| if (omnibox_view_->IsEditingOrEmpty() ||
|
| omnibox_view_->model()->is_keyword_hint()) {
|
| @@ -904,7 +918,8 @@ void LocationBarViewMac::UpdateSecurityState(bool tab_changed) {
|
| // out, animate it back in. Otherwise, if the security state has changed,
|
| // animate the decoration if animation is enabled and the state changed is
|
| // not from a tab switch.
|
| - if (ShouldShowSecurityState() && is_width_available_for_security_verbose_) {
|
| + if ((ShouldShowSecurityState() || ShouldShowExtensionBubble()) &&
|
| + is_width_available_for_security_verbose_) {
|
| bool is_secure_to_secure = IsSecureConnection(new_security_level) &&
|
| IsSecureConnection(security_level_);
|
| bool is_new_security_level =
|
|
|