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

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

Issue 2378623007: [Material] Update Material Security Verbose Decoration Flag (Closed)
Patch Set: Rebased again Created 4 years, 2 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 3d36ab210a7dff4291962d9524a459f2e1300723..cce1e9c1d31ad96ddcb112fbee7938ee29ca4738 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
@@ -122,7 +122,8 @@ LocationBarViewMac::LocationBarViewMac(AutocompleteTextField* field,
browser_(browser),
location_bar_visible_(true),
should_show_secure_verbose_(true),
- should_animate_security_verbose_(true),
+ should_animate_secure_verbose_(false),
+ should_animate_nonsecure_verbose_(false),
is_width_available_for_security_verbose_(false),
weak_ptr_factory_(this) {
ScopedVector<ContentSettingImageModel> models =
@@ -146,21 +147,23 @@ LocationBarViewMac::LocationBarViewMac(AutocompleteTextField* field,
!browser->SupportsWindowFeature(Browser::FEATURE_TABSTRIP)];
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(switches::kMaterialSecurityVerbose)) {
- std::string security_verbose_flag =
- command_line->GetSwitchValueASCII(switches::kMaterialSecurityVerbose);
-
+ if (command_line->HasSwitch(switches::kSecurityChip)) {
+ std::string security_chip_flag =
+ command_line->GetSwitchValueASCII(switches::kSecurityChip);
should_show_secure_verbose_ =
- security_verbose_flag ==
- switches::kMaterialSecurityVerboseShowAllAnimated ||
- security_verbose_flag ==
- switches::kMaterialSecurityVerboseShowAllNonAnimated;
-
- should_animate_security_verbose_ =
- security_verbose_flag ==
- switches::kMaterialSecurityVerboseShowAllAnimated ||
- security_verbose_flag ==
- switches::kMaterialSecurityVerboseShowNonSecureAnimated;
+ security_chip_flag == switches::kSecurityChipShowAll;
+ }
+
+ if (command_line->HasSwitch(switches::kSecurityChipAnimation)) {
+ std::string security_chip_animation_flag =
+ command_line->GetSwitchValueASCII(switches::kSecurityChipAnimation);
+ should_animate_secure_verbose_ =
+ security_chip_animation_flag == switches::kSecurityChipAnimationAll;
+
+ should_animate_nonsecure_verbose_ =
+ security_chip_animation_flag ==
+ switches::kSecurityChipAnimationNonSecureOnly ||
+ security_chip_animation_flag == switches::kSecurityChipAnimationAll;
}
// Sets images for the decorations, and performs a layout. This call ensures
@@ -872,8 +875,9 @@ void LocationBarViewMac::UpdateSecurityState(bool tab_changed) {
security_state::SecurityStateModel::SecurityLevel new_security_level =
GetToolbarModel()->GetSecurityLevel(false);
- bool is_secure_to_secure = IsSecureConnection(new_security_level) &&
- IsSecureConnection(security_level_);
+ bool is_new_level_secure = IsSecureConnection(new_security_level);
+ bool is_secure_to_secure =
+ is_new_level_secure && IsSecureConnection(security_level_);
bool is_new_security_level =
security_level_ != new_security_level && !is_secure_to_secure;
security_level_ = new_security_level;
@@ -883,9 +887,13 @@ void LocationBarViewMac::UpdateSecurityState(bool tab_changed) {
// animate the decoration if animation is enabled and the state changed is
// not from a tab switch.
if (is_width_available_for_security_verbose_) {
+ bool is_animated =
+ (is_new_level_secure && should_animate_secure_verbose_) ||
+ (!is_new_level_secure && should_animate_nonsecure_verbose_);
+
if (security_state_bubble_decoration_->HasAnimatedOut())
security_state_bubble_decoration_->AnimateIn(false);
- else if (!should_animate_security_verbose_ || tab_changed)
+ else if (tab_changed || !is_animated)
security_state_bubble_decoration_->ShowWithoutAnimation();
else if (is_new_security_level)
security_state_bubble_decoration_->AnimateIn();
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h ('k') | chrome/browser/ui/views/location_bar/location_bar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698