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

Unified Diff: chrome/browser/policy/chrome_browser_policy_connector.cc

Issue 930243008: Enable NPAPI plugins if any plugin policies are set. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nits. fix failing test. Created 5 years, 10 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
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
« no previous file with comments | « chrome/browser/policy/chrome_browser_policy_connector.h ('k') | content/browser/download/download_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698