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

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

Issue 2431223007: [Views][Mac] Security Chip Default Value (Closed)
Patch Set: 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 ded3cb3ddadf93bce3220dfe5156918951888abe..61a31269f7720fd7553bbcdf908f7263af8fd1c9 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
@@ -121,7 +121,8 @@ LocationBarViewMac::LocationBarViewMac(AutocompleteTextField* field,
new ManagePasswordsDecoration(command_updater, this)),
browser_(browser),
location_bar_visible_(true),
- should_show_secure_verbose_(true),
+ should_show_secure_verbose_(false),
+ should_show_nonsecure_verbose_(false),
should_animate_security_verbose_(false),
is_width_available_for_security_verbose_(false),
weak_ptr_factory_(this) {
@@ -149,13 +150,14 @@ LocationBarViewMac::LocationBarViewMac(AutocompleteTextField* field,
if (command_line->HasSwitch(switches::kMaterialSecurityVerbose)) {
std::string security_verbose_flag =
command_line->GetSwitchValueASCII(switches::kMaterialSecurityVerbose);
-
should_show_secure_verbose_ =
security_verbose_flag ==
switches::kMaterialSecurityVerboseShowAllAnimated ||
security_verbose_flag ==
switches::kMaterialSecurityVerboseShowAllNonAnimated;
+ should_show_nonsecure_verbose_ = true;
+
should_animate_security_verbose_ =
security_verbose_flag ==
switches::kMaterialSecurityVerboseShowAllAnimated ||
@@ -675,20 +677,25 @@ WebContents* LocationBarViewMac::GetWebContents() {
}
bool LocationBarViewMac::ShouldShowEVBubble() const {
- return (GetToolbarModel()->GetSecurityLevel(false) ==
- security_state::SecurityStateModel::EV_SECURE) &&
- should_show_secure_verbose_;
+ return GetToolbarModel()->GetSecurityLevel(false) ==
+ security_state::SecurityStateModel::EV_SECURE;
}
bool LocationBarViewMac::ShouldShowSecurityState() const {
+ if (omnibox_view_->IsEditingOrEmpty() ||
+ omnibox_view_->model()->is_keyword_hint()) {
+ return false;
+ }
+
security_state::SecurityStateModel::SecurityLevel security =
GetToolbarModel()->GetSecurityLevel(false);
- bool has_verbose_for_security =
- security == security_state::SecurityStateModel::DANGEROUS ||
- (IsSecureConnection(security) && should_show_secure_verbose_);
+ if (security == security_state::SecurityStateModel::EV_SECURE)
+ return true;
+ else if (security == security_state::SecurityStateModel::SECURE)
+ return should_show_secure_verbose_;
- return has_verbose_for_security && !omnibox_view_->IsEditingOrEmpty() &&
- !omnibox_view_->model()->is_keyword_hint();
+ return should_show_nonsecure_verbose_ &&
+ security == security_state::SecurityStateModel::DANGEROUS;
}
bool LocationBarViewMac::IsLocationBarDark() const {
« 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