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

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

Issue 2422303002: Show HTTP-Bad security chip UI on Mac and Views (Closed)
Patch Set: Fix typo 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/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 38c7c2eed4e6543dd38a0f97badb21c5cea3d7a3..dc70d7e0941044f68f99b9128b13e542d240f70c 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -825,7 +825,8 @@ void LocationBarView::RefreshLocationIcon() {
security_state::SecurityStateModel::SecurityLevel security_level =
GetToolbarModel()->GetSecurityLevel(false);
SkColor icon_color =
- (security_level == security_state::SecurityStateModel::NONE)
+ (security_level == security_state::SecurityStateModel::NONE ||
+ security_level == security_state::SecurityStateModel::HTTP_SHOW_WARNING)
? color_utils::DeriveDefaultIconColor(GetColor(TEXT))
: GetSecureTextColor(security_level);
location_icon_view_->SetImage(gfx::CreateVectorIcon(
@@ -1014,22 +1015,23 @@ bool LocationBarView::ShouldShowEVBubble() const {
bool LocationBarView::ShouldShowSecurityChip() const {
using SecurityLevel = security_state::SecurityStateModel::SecurityLevel;
- SecurityLevel level = GetToolbarModel()->GetSecurityLevel(false);
- return ((level == SecurityLevel::SECURE ||
- level == SecurityLevel::EV_SECURE) &&
- should_show_secure_state_) ||
- level == SecurityLevel::DANGEROUS;
+ const SecurityLevel level = GetToolbarModel()->GetSecurityLevel(false);
+ if (level == SecurityLevel::SECURE || level == SecurityLevel::EV_SECURE)
+ return should_show_secure_state_;
+ return level == SecurityLevel::DANGEROUS ||
+ level == SecurityLevel::HTTP_SHOW_WARNING;
}
bool LocationBarView::ShouldAnimateSecurityChip() const {
using SecurityLevel = security_state::SecurityStateModel::SecurityLevel;
SecurityLevel level = GetToolbarModel()->GetSecurityLevel(false);
- bool is_secure_level =
- level == SecurityLevel::EV_SECURE || level == SecurityLevel::SECURE;
- return ShouldShowSecurityChip() &&
- ((level == SecurityLevel::DANGEROUS &&
- should_animate_nonsecure_state_) ||
- (is_secure_level && should_animate_secure_state_));
+ if (!ShouldShowSecurityChip())
+ return false;
+ if (level == SecurityLevel::SECURE || level == SecurityLevel::EV_SECURE)
+ return should_animate_secure_state_;
+ return should_animate_nonsecure_state_ &&
+ (level == SecurityLevel::DANGEROUS ||
+ level == SecurityLevel::HTTP_SHOW_WARNING);
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm ('k') | components/toolbar/toolbar_model_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698