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..ca3122b1e04d38607f74bb0356c80cd430fe4e28 100644 |
--- a/chrome/browser/ui/toolbar/toolbar_model_impl.cc |
+++ b/chrome/browser/ui/toolbar/toolbar_model_impl.cc |
@@ -65,6 +65,20 @@ bool GetSecurityLevelForFieldTrialGroup(const std::string& group, |
return true; |
} |
+ToolbarModel::SecurityLevel GetSecurityLevelForHttpFieldTrial() { |
+ std::string group = base::FieldTrialList::FindFullName("MarkHTTPAsNonSecure"); |
+ std::string choice = base::CommandLine::ForCurrentProcess()-> |
+ GetSwitchValueASCII(switches::kMarkHttpAsNonSecure); |
+ |
+ if (choice == "no" || group == "no") |
felt
2014/12/23 01:34:58
Doesn't this mean that as long as the Finch trial
palmer
2015/01/07 00:59:00
You're right, thanks. Changing it so that the user
|
+ return ToolbarModel::NONE; |
+ else if (choice == "dubious" || group == "dubious") |
+ return ToolbarModel::SECURITY_WARNING; |
+ else if (choice == "non-secure" || group == "non-secure") |
+ return ToolbarModel::SECURITY_ERROR; |
+ return ToolbarModel::NONE; |
+} |
+ |
} // namespace |
ToolbarModelImpl::ToolbarModelImpl(ToolbarModelDelegate* delegate) |
@@ -87,9 +101,15 @@ 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: { |
+ const GURL& url = entry->GetURL(); |
+ if (url.SchemeIs("http") || url.SchemeIs("ftp")) |
+ return GetSecurityLevelForHttpFieldTrial(); |
+ return NONE; |
+ } |
+ |
case content::SECURITY_STYLE_AUTHENTICATION_BROKEN: |
return SECURITY_ERROR; |