OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 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/policy/configuration_policy_store_interface.h" | |
6 | |
7 #include "base/values.h" | |
8 | |
9 namespace { | |
10 | |
11 bool IsProxyPolicy(policy::ConfigurationPolicyType policy) { | |
12 return policy == policy::kPolicyProxyMode || | |
13 policy == policy::kPolicyProxyServerMode || | |
14 policy == policy::kPolicyProxyServer || | |
15 policy == policy::kPolicyProxyPacUrl || | |
16 policy == policy::kPolicyProxyBypassList; | |
17 } | |
18 | |
19 } // namespace | |
20 | |
21 namespace policy { | |
22 | |
23 void ObservingPolicyStoreInterface::Apply(ConfigurationPolicyType policy, | |
24 Value* value) { | |
25 next_->Apply(policy, value); | |
26 | |
27 if (IsProxyPolicy(policy)) | |
28 proxy_policy_applied_ = true; | |
29 } | |
30 | |
31 void FilteringPolicyStoreInterface::Apply(ConfigurationPolicyType policy, | |
32 Value* value) { | |
33 // Apply() takes ownership of |value|. | |
34 if (IsProxyPolicy(policy) && apply_proxy_policies_) | |
35 next_->Apply(policy, value); | |
36 else | |
37 delete value; | |
38 } | |
39 | |
40 } // namespace policy | |
OLD | NEW |