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

Side by Side Diff: chrome/browser/plugins/plugin_policy_handler.cc

Issue 1071713004: Enable NPAPI if policy has plugin policies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: code review changes Created 5 years, 8 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/plugins/plugin_policy_handler.h"
6
7 #include "base/logging.h"
8 #include "base/prefs/pref_value_map.h"
9 #include "base/values.h"
10 #include "chrome/common/pref_names.h"
11 #include "components/policy/core/browser/policy_error_map.h"
12 #include "components/policy/core/common/policy_map.h"
13 #include "policy/policy_constants.h"
14
15 namespace policy {
16
17 PluginPolicyHandler::PluginPolicyHandler() {}
18
19 PluginPolicyHandler::~PluginPolicyHandler() {}
20
21 void PluginPolicyHandler::ApplyPolicySettings(const PolicyMap& policies,
22 PrefValueMap* prefs) {
23 const std::string plugin_policies[] = { key::kEnabledPlugins,
24 key::kPluginsAllowedForUrls,
25 key::kPluginsBlockedForUrls,
26 key::kDisabledPluginsExceptions,
27 key::kDisabledPlugins };
28
29 for (auto policy : plugin_policies) {
30 if (policies.GetValue(policy)) {
31 prefs->SetBoolean(prefs::kEnableNpapi, true);
32 break;
33 }
34 }
35 }
36
37 bool PluginPolicyHandler::CheckPolicySettings(const PolicyMap& policies,
38 PolicyErrorMap* prefs) {
39 return true;
40 }
41
42 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698