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

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

Issue 2650843002: [Mac] Security Chip Animation Edge Cases (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698