Chromium Code Reviews| 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..4aa4c4eb8e9e989bbcd0565e53c734875ba744c5 100644 |
| --- a/chrome/browser/ui/toolbar/toolbar_model_impl.cc |
| +++ b/chrome/browser/ui/toolbar/toolbar_model_impl.cc |
| @@ -65,6 +65,22 @@ bool GetSecurityLevelForFieldTrialGroup(const std::string& group, |
| return true; |
| } |
| +bool GetSecurityLevelForHttpFieldTrial(ToolbarModel::SecurityLevel* level) { |
|
jww
2014/12/20 02:07:58
This certainly works, but instead of returning a b
palmer
2014/12/20 02:32:33
I modeled this after GetSecurityLevelForFieldTrial
|
| + std::string group = base::FieldTrialList::FindFullName("MarkHTTPAsNonSecure"); |
| + std::string choice = base::CommandLine::ForCurrentProcess()-> |
| + GetSwitchValueASCII(switches::kMarkHttpAsNonSecure); |
| + |
| + if (choice == "no" || group == "no") |
| + *level = ToolbarModel::NONE; |
| + else if (choice == "dubious" || group == "dubious") |
| + *level = ToolbarModel::SECURITY_WARNING; |
| + else if (choice == "non-secure" || group == "non-secure") |
| + *level = ToolbarModel::SECURITY_ERROR; |
| + else |
| + return false; |
| + return true; |
|
jww
2014/12/20 02:07:58
This is unreachable code.
palmer
2014/12/20 02:32:34
I'm not sure why?
|
| +} |
| + |
| } // namespace |
| ToolbarModelImpl::ToolbarModelImpl(ToolbarModelDelegate* delegate) |
| @@ -87,8 +103,13 @@ 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: { |
| + ToolbarModel::SecurityLevel security_level = NONE; |
| + if (GetSecurityLevelForHttpFieldTrial(&security_level)) |
| + return security_level; |
| + return NONE; |
| + } |
| case content::SECURITY_STYLE_AUTHENTICATION_BROKEN: |
| return SECURITY_ERROR; |