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

Side by Side Diff: components/policy/core/common/proxy_policy_provider.cc

Issue 1304843004: Add source column to chrome://policy showing the origins of policies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed browsertest and removed unnecessary string for default values. Created 5 years, 3 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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698