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

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: add missing files 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 2013 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 const char* policy_name,
19 const char* pref_path,
20 base::Value::Type value_type)
21 : TypeCheckingPolicyHandler(policy_name, value_type),
22 pref_path_(pref_path) {
23 }
24
25 PluginPolicyHandler::~PluginPolicyHandler() {}
26
27 void PluginPolicyHandler::ApplyPolicySettings(const PolicyMap& policies,
28 PrefValueMap* prefs) {
29 if (!pref_path_)
30 return;
31 const base::Value* value = policies.GetValue(policy_name());
32 if (value) {
33 prefs->SetBoolean(prefs::kEnableNpapi, true);
Mattias Nissler (ping if slow) 2015/04/10 08:47:15 You have multiple instances of this policy handler
Will Harris 2015/04/10 18:51:23 Done.
34 prefs->SetValue(pref_path_, value->DeepCopy());
35 }
36 }
37
38 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698