OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/policy/core/common/proxy_policy_provider.h" | 5 #include "components/policy/core/common/proxy_policy_provider.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "components/policy/core/common/policy_bundle.h" | 9 #include "components/policy/core/common/policy_bundle.h" |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
45 } else { | 45 } else { |
46 // Subtle: if a RefreshPolicies() call comes after Shutdown() then the | 46 // Subtle: if a RefreshPolicies() call comes after Shutdown() then the |
47 // current bundle should be served instead. This also does the right thing | 47 // current bundle should be served instead. This also does the right thing |
48 // if SetDelegate() was never called before. | 48 // if SetDelegate() was never called before. |
49 scoped_ptr<PolicyBundle> bundle(new PolicyBundle()); | 49 scoped_ptr<PolicyBundle> bundle(new PolicyBundle()); |
50 bundle->CopyFrom(policies()); | 50 bundle->CopyFrom(policies()); |
51 UpdatePolicy(bundle.Pass()); | 51 UpdatePolicy(bundle.Pass()); |
52 } | 52 } |
53 } | 53 } |
54 | 54 |
55 PolicySource ProxyPolicyProvider::source() const { | |
Thiemo Nagel
2015/09/01 17:40:37
Remove.
fhorschig
2015/09/04 06:53:55
Done.
| |
56 if (delegate_) | |
57 return delegate_->source(); | |
58 return POLICY_SOURCE_DEFAULT; | |
59 } | |
60 | |
55 void ProxyPolicyProvider::OnUpdatePolicy( | 61 void ProxyPolicyProvider::OnUpdatePolicy( |
56 ConfigurationPolicyProvider* provider) { | 62 ConfigurationPolicyProvider* provider) { |
57 DCHECK_EQ(delegate_, provider); | 63 DCHECK_EQ(delegate_, provider); |
58 scoped_ptr<PolicyBundle> bundle(new PolicyBundle()); | 64 scoped_ptr<PolicyBundle> bundle(new PolicyBundle()); |
59 bundle->CopyFrom(delegate_->policies()); | 65 bundle->CopyFrom(delegate_->policies()); |
60 UpdatePolicy(bundle.Pass()); | 66 UpdatePolicy(bundle.Pass()); |
61 } | 67 } |
62 | 68 |
63 } // namespace policy | 69 } // namespace policy |
OLD | NEW |