| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/policy/proxy_policy_provider.h" | 5 #include "chrome/browser/policy/proxy_policy_provider.h" |
| 6 | 6 |
| 7 #include "policy/policy_constants.h" | |
| 8 | |
| 9 namespace policy { | 7 namespace policy { |
| 10 | 8 |
| 11 ProxyPolicyProvider::ProxyPolicyProvider() | 9 ProxyPolicyProvider::ProxyPolicyProvider() {} |
| 12 : ConfigurationPolicyProvider(GetChromePolicyDefinitionList()) {} | |
| 13 | 10 |
| 14 ProxyPolicyProvider::~ProxyPolicyProvider() {} | 11 ProxyPolicyProvider::~ProxyPolicyProvider() {} |
| 15 | 12 |
| 16 void ProxyPolicyProvider::SetDelegate(ConfigurationPolicyProvider* delegate) { | 13 void ProxyPolicyProvider::SetDelegate(ConfigurationPolicyProvider* delegate) { |
| 17 if (delegate) { | 14 if (delegate) { |
| 18 registrar_.reset(new ConfigurationPolicyObserverRegistrar()); | 15 registrar_.reset(new ConfigurationPolicyObserverRegistrar()); |
| 19 registrar_->Init(delegate, this); | 16 registrar_->Init(delegate, this); |
| 20 OnUpdatePolicy(delegate); | 17 OnUpdatePolicy(delegate); |
| 21 } else { | 18 } else { |
| 22 registrar_.reset(); | 19 registrar_.reset(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 39 UpdatePolicy(bundle.Pass()); | 36 UpdatePolicy(bundle.Pass()); |
| 40 } | 37 } |
| 41 | 38 |
| 42 void ProxyPolicyProvider::OnProviderGoingAway( | 39 void ProxyPolicyProvider::OnProviderGoingAway( |
| 43 ConfigurationPolicyProvider* provider) { | 40 ConfigurationPolicyProvider* provider) { |
| 44 registrar_.reset(); | 41 registrar_.reset(); |
| 45 UpdatePolicy(scoped_ptr<PolicyBundle>(new PolicyBundle())); | 42 UpdatePolicy(scoped_ptr<PolicyBundle>(new PolicyBundle())); |
| 46 } | 43 } |
| 47 | 44 |
| 48 } // namespace policy | 45 } // namespace policy |
| OLD | NEW |