Chromium Code Reviews| Index: chrome/browser/policy/chrome_browser_policy_connector.cc |
| diff --git a/chrome/browser/policy/chrome_browser_policy_connector.cc b/chrome/browser/policy/chrome_browser_policy_connector.cc |
| index 24ce2a6ab0f3793e69dd4ffef79be0f213faa47d..e233a87584d5ac6556cc9090c82d3f48e5cdc302 100644 |
| --- a/chrome/browser/policy/chrome_browser_policy_connector.cc |
| +++ b/chrome/browser/policy/chrome_browser_policy_connector.cc |
| @@ -25,6 +25,7 @@ |
| #include "components/policy/core/common/policy_types.h" |
| #include "components/signin/core/common/signin_switches.h" |
| #include "content/public/browser/browser_thread.h" |
| +#include "content/public/common/content_switches.h" |
| #include "net/url_request/url_request_context_getter.h" |
| #include "policy/policy_constants.h" |
| @@ -89,7 +90,7 @@ void ChromeBrowserPolicyConnector::Init( |
| BrowserPolicyConnector::Init( |
| local_state, request_context, device_management_service.Pass()); |
| - AppendExtraFlagPerPolicy(); |
| + AppendExtraFlagsPerPolicy(); |
| } |
| ConfigurationPolicyProvider* |
| @@ -123,7 +124,7 @@ ConfigurationPolicyProvider* |
| #endif |
| } |
| -void ChromeBrowserPolicyConnector::AppendExtraFlagPerPolicy() { |
| +void ChromeBrowserPolicyConnector::AppendExtraFlagsPerPolicy() { |
| PolicyService* policy_service = GetPolicyService(); |
| PolicyNamespace chrome_ns = PolicyNamespace(POLICY_DOMAIN_CHROME, ""); |
| const PolicyMap& chrome_policy = policy_service->GetPolicies(chrome_ns); |
| @@ -139,6 +140,23 @@ void ChromeBrowserPolicyConnector::AppendExtraFlagPerPolicy() { |
| if (!command_line->HasSwitch(switches::kEnableIframeBasedSignin)) |
| command_line->AppendSwitch(switches::kEnableIframeBasedSignin); |
| } |
| + |
| + if (command_line->HasSwitch(switches::kEnableNpapi)) |
| + return; |
| + |
| + // The list of Plugin related policies that re-enable NPAPI. Remove once NPAPI |
| + // is dead. |
| + const std::string plugin_policies[] = { key::kEnabledPlugins, |
| + key::kPluginsAllowedForUrls, |
| + key::kPluginsBlockedForUrls, |
| + key::kDisabledPluginsExceptions, |
| + key::kDisabledPlugins }; |
|
Andrew T Wilson (Slow)
2015/02/20 10:28:27
I suspect checking DisabledPlugins is not needed h
|
| + for (auto policy : plugin_policies) { |
| + if (chrome_policy.GetValue(policy)) { |
| + command_line->AppendSwitch(switches::kEnableNpapi); |
| + break; |
| + } |
| + } |
| } |
| } // namespace policy |