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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 2378623007: [Material] Update Material Security Verbose Decoration Flag (Closed)
Patch Set: Rebased 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
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/location_bar/location_bar_view.cc
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index 6196e8e18045cd2f9aa25fb5f045366cf87c6dfd..5cae53889b40752440bd74f39d2bc840d09ad917 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -141,7 +141,8 @@ LocationBarView::LocationBarView(Browser* browser,
template_url_service_(NULL),
web_contents_null_at_last_refresh_(true),
should_show_secure_state_(true),
- should_animate_secure_state_(true) {
+ should_animate_secure_state_(false),
+ should_animate_nonsecure_state_(false) {
edit_bookmarks_enabled_.Init(
bookmarks::prefs::kEditBookmarksEnabled, profile->GetPrefs(),
base::Bind(&LocationBarView::UpdateWithoutTabRestore,
@@ -151,21 +152,31 @@ LocationBarView::LocationBarView(Browser* browser,
->AddZoomEventManagerObserver(this);
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(switches::kMaterialSecurityVerbose)) {
+ if (command_line->HasSwitch(switches::kSecurityVerboseDecoration)) {
std::string security_verbose_flag =
- command_line->GetSwitchValueASCII(switches::kMaterialSecurityVerbose);
+ command_line->GetSwitchValueASCII(switches::kSecurityVerboseDecoration);
should_show_secure_state_ =
security_verbose_flag ==
- switches::kMaterialSecurityVerboseShowAllAnimated ||
+ switches::kSecurityVerboseDecorationShowAllAnimated ||
security_verbose_flag ==
- switches::kMaterialSecurityVerboseShowAllNonAnimated;
+ switches::kSecurityVerboseDecorationShowAllNonAnimated ||
+ security_verbose_flag ==
+ switches::
+ kSecurityVerboseDecorationShowAllWithOnlyNonSecureAnimated;
should_animate_secure_state_ =
security_verbose_flag ==
- switches::kMaterialSecurityVerboseShowAllAnimated ||
+ switches::kSecurityVerboseDecorationShowAllAnimated;
+
+ should_animate_nonsecure_state_ =
+ security_verbose_flag ==
+ switches::kSecurityVerboseDecorationShowAllAnimated ||
+ security_verbose_flag ==
+ switches::kSecurityVerboseDecorationShowNonSecureAnimated ||
security_verbose_flag ==
- switches::kMaterialSecurityVerboseShowNonSecureAnimated;
+ switches::
+ kSecurityVerboseDecorationShowAllWithOnlyNonSecureAnimated;
}
}
@@ -771,8 +782,19 @@ void LocationBarView::Update(const WebContents* contents) {
omnibox_view_->Update();
bool should_show = ShouldShowSecurityChip();
Kevin Bailey 2016/10/04 15:10:17 You'll need Peter's approval for this file, but sp
spqchan 2016/10/05 01:39:49 Sounds good, I'll add pkasting. I wanted to get a
- location_icon_view_->SetSecurityState(
- should_show, should_show && !contents && should_animate_secure_state_);
+
+ security_state::SecurityStateModel::SecurityLevel security_level =
+ GetToolbarModel()->GetSecurityLevel(false);
+ bool is_secure_level =
+ security_level == security_state::SecurityStateModel::EV_SECURE ||
+ security_level == security_state::SecurityStateModel::SECURE;
+ bool should_animate =
+ should_show && !contents &&
+ ((security_level == security_state::SecurityStateModel::DANGEROUS &&
+ should_animate_nonsecure_state_) ||
+ (is_secure_level && should_animate_secure_state_));
+
+ location_icon_view_->SetSecurityState(should_show, should_animate);
OnChanged(); // NOTE: Calls Layout().
}
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698