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

Unified Diff: chrome/browser/ui/toolbar/toolbar_model_impl.cc

Issue 813873005: Add field trial and flag to mark HTTP as non-secure. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/toolbar/toolbar_model_impl.cc
diff --git a/chrome/browser/ui/toolbar/toolbar_model_impl.cc b/chrome/browser/ui/toolbar/toolbar_model_impl.cc
index 8f2edcd0c7b07c1d13c637eff1042f1a1c57b671..78ec34493e92a4f3a1aa602ef444e3513008e071 100644
--- a/chrome/browser/ui/toolbar/toolbar_model_impl.cc
+++ b/chrome/browser/ui/toolbar/toolbar_model_impl.cc
@@ -87,8 +87,27 @@ ToolbarModel::SecurityLevel ToolbarModelImpl::GetSecurityLevelForWebContents(
const SSLStatus& ssl = entry->GetSSL();
switch (ssl.security_style) {
case content::SECURITY_STYLE_UNKNOWN:
- case content::SECURITY_STYLE_UNAUTHENTICATED:
return NONE;
+ case content::SECURITY_STYLE_UNAUTHENTICATED: {
+ base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
+ std::string choice =
+ cmd->GetSwitchValueASCII(switches::kMarkHttpAsNonSecure);
+ if (choice.empty()) {
+ ToolbarModel::SecurityLevel security_level = NONE;
+ if (GetSecurityLevelForFieldTrialGroup(
jww 2014/12/20 01:21:57 According to Finch documentation, you should actua
Ryan Sleevi 2014/12/20 01:29:32 See https://goto.google.com/finch-and-flags
palmer 2014/12/20 01:59:53 OK, I think I did this right. I'm sure you'll let
+ base::FieldTrialList::FindFullName("MarkHTTPAsNonSecure"),
+ &security_level)) {
+ return security_level;
+ }
+ return NONE;
+ } else if (choice == "dubious") {
+ return ToolbarModel::SECURITY_WARNING;
+ } else if (choice == "non-secure") {
+ return ToolbarModel::SECURITY_ERROR;
+ } else {
+ return NONE;
+ }
+ }
case content::SECURITY_STYLE_AUTHENTICATION_BROKEN:
return SECURITY_ERROR;

Powered by Google App Engine
This is Rietveld 408576698