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

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

Issue 2435493003: [Views][Mac] Security Chip Default Value (Closed)
Patch Set: Fix for pkasting 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') | no next file » | 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 dc70d7e0941044f68f99b9128b13e542d240f70c..3e237665b3c5a2c7d1d73deb840e0f2384400666 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -140,7 +140,8 @@ LocationBarView::LocationBarView(Browser* browser,
show_focus_rect_(false),
template_url_service_(NULL),
web_contents_null_at_last_refresh_(true),
- should_show_secure_state_(true),
+ should_show_secure_state_(false),
+ should_show_nonsecure_state_(false),
should_animate_secure_state_(false),
should_animate_nonsecure_state_(false) {
edit_bookmarks_enabled_.Init(
@@ -157,6 +158,9 @@ LocationBarView::LocationBarView(Browser* browser,
command_line->GetSwitchValueASCII(switches::kSecurityChip);
should_show_secure_state_ =
security_chip_flag == switches::kSecurityChipShowAll;
+ should_show_nonsecure_state_ =
+ security_chip_flag == switches::kSecurityChipShowAll ||
+ security_chip_flag == switches::kSecurityChipShowNonSecureOnly;
}
if (command_line->HasSwitch(switches::kSecurityChipAnimation)) {
@@ -998,8 +1002,10 @@ bool LocationBarView::HasValidSuggestText() const {
}
base::string16 LocationBarView::GetSecurityText() const {
- return ShouldShowEVBubble() ? GetToolbarModel()->GetEVCertName()
- : GetToolbarModel()->GetSecureVerboseText();
+ bool has_ev_cert = (GetToolbarModel()->GetSecurityLevel(false) ==
+ security_state::SecurityStateModel::EV_SECURE);
+ return has_ev_cert ? GetToolbarModel()->GetEVCertName()
+ : GetToolbarModel()->GetSecureVerboseText();
}
bool LocationBarView::ShouldShowKeywordBubble() const {
@@ -1007,19 +1013,18 @@ bool LocationBarView::ShouldShowKeywordBubble() const {
!omnibox_view_->model()->is_keyword_hint();
}
-bool LocationBarView::ShouldShowEVBubble() const {
- return (GetToolbarModel()->GetSecurityLevel(false) ==
- security_state::SecurityStateModel::EV_SECURE) &&
- should_show_secure_state_;
-}
-
bool LocationBarView::ShouldShowSecurityChip() const {
using SecurityLevel = security_state::SecurityStateModel::SecurityLevel;
const SecurityLevel level = GetToolbarModel()->GetSecurityLevel(false);
- if (level == SecurityLevel::SECURE || level == SecurityLevel::EV_SECURE)
+ if (level == SecurityLevel::EV_SECURE) {
+ return true;
+ } else if (level == SecurityLevel::SECURE) {
return should_show_secure_state_;
- return level == SecurityLevel::DANGEROUS ||
- level == SecurityLevel::HTTP_SHOW_WARNING;
+ } else {
+ return should_show_nonsecure_state_ &&
+ (level == SecurityLevel::DANGEROUS ||
+ level == SecurityLevel::HTTP_SHOW_WARNING);
+ }
}
bool LocationBarView::ShouldAnimateSecurityChip() const {
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698