Chromium Code Reviews| 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 01df50cd5d5298f85c692c1c1a49b3f47028cb02..06e6398fcb3654dc158822fbc5240ba0386b99f4 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 |
| @@ -874,10 +874,14 @@ bool LocationBarViewMac::UpdateZoomDecoration(bool default_zoom_changed) { |
| IsLocationBarDark()); |
| } |
| +// TODO(spqchan): Add tests for the security state decoration. |
|
Robert Sesek
2017/01/24 16:52:54
Yes please :)
|
| void LocationBarViewMac::UpdateSecurityState(bool tab_changed) { |
| using SecurityLevel = security_state::SecurityLevel; |
| SecurityLevel new_security_level = GetToolbarModel()->GetSecurityLevel(false); |
| + if (tab_changed) |
| + security_state_bubble_decoration_->ResetAnimation(); |
| + |
| // If there's enough space, but the secure state decoration had animated |
| // out, animate it back in. Otherwise, if the security state has changed, |
| // animate the decoration if animation is enabled and the state changed is |
| @@ -905,8 +909,9 @@ void LocationBarViewMac::UpdateSecurityState(bool tab_changed) { |
| bool LocationBarViewMac::CanAnimateSecurityLevel( |
| security_state::SecurityLevel level) const { |
| - return security_level_ == security_state::SecurityLevel::DANGEROUS || |
| - security_level_ == security_state::SecurityLevel::HTTP_SHOW_WARNING; |
| + return !GetOmniboxView()->IsEditingOrEmpty() && |
| + (security_level_ == security_state::SecurityLevel::DANGEROUS || |
| + security_level_ == security_state::SecurityLevel::HTTP_SHOW_WARNING); |
| } |
| bool LocationBarViewMac::IsSecureConnection( |