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

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

Issue 2422083002: Remove usage of FOR_EACH_OBSERVER macro in components/policy (Closed)
Patch Set: Created 4 years, 2 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 2013 The Chromium Authors. All rights reserved. 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 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/configuration_policy_provider.h" 5 #include "components/policy/core/common/configuration_policy_provider.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "components/policy/core/common/external_data_fetcher.h" 8 #include "components/policy/core/common/external_data_fetcher.h"
9 #include "components/policy/core/common/policy_map.h" 9 #include "components/policy/core/common/policy_map.h"
10 10
(...skipping 29 matching lines...) Expand all
40 PolicyDomain domain) const { 40 PolicyDomain domain) const {
41 return true; 41 return true;
42 } 42 }
43 43
44 void ConfigurationPolicyProvider::UpdatePolicy( 44 void ConfigurationPolicyProvider::UpdatePolicy(
45 std::unique_ptr<PolicyBundle> bundle) { 45 std::unique_ptr<PolicyBundle> bundle) {
46 if (bundle.get()) 46 if (bundle.get())
47 policy_bundle_.Swap(bundle.get()); 47 policy_bundle_.Swap(bundle.get());
48 else 48 else
49 policy_bundle_.Clear(); 49 policy_bundle_.Clear();
50 FOR_EACH_OBSERVER(ConfigurationPolicyProvider::Observer, 50 for (auto& observer : observer_list_)
51 observer_list_, 51 observer.OnUpdatePolicy(this);
52 OnUpdatePolicy(this));
53 } 52 }
54 53
55 SchemaRegistry* ConfigurationPolicyProvider::schema_registry() const { 54 SchemaRegistry* ConfigurationPolicyProvider::schema_registry() const {
56 return schema_registry_; 55 return schema_registry_;
57 } 56 }
58 57
59 const scoped_refptr<SchemaMap>& 58 const scoped_refptr<SchemaMap>&
60 ConfigurationPolicyProvider::schema_map() const { 59 ConfigurationPolicyProvider::schema_map() const {
61 return schema_registry_->schema_map(); 60 return schema_registry_->schema_map();
62 } 61 }
63 62
64 void ConfigurationPolicyProvider::AddObserver(Observer* observer) { 63 void ConfigurationPolicyProvider::AddObserver(Observer* observer) {
65 observer_list_.AddObserver(observer); 64 observer_list_.AddObserver(observer);
66 } 65 }
67 66
68 void ConfigurationPolicyProvider::RemoveObserver(Observer* observer) { 67 void ConfigurationPolicyProvider::RemoveObserver(Observer* observer) {
69 observer_list_.RemoveObserver(observer); 68 observer_list_.RemoveObserver(observer);
70 } 69 }
71 70
72 void ConfigurationPolicyProvider::OnSchemaRegistryUpdated( 71 void ConfigurationPolicyProvider::OnSchemaRegistryUpdated(
73 bool has_new_schemas) {} 72 bool has_new_schemas) {}
74 73
75 void ConfigurationPolicyProvider::OnSchemaRegistryReady() {} 74 void ConfigurationPolicyProvider::OnSchemaRegistryReady() {}
76 75
77 } // namespace policy 76 } // namespace policy
OLDNEW
« no previous file with comments | « components/policy/core/common/cloud/cloud_policy_store.cc ('k') | components/policy/core/common/policy_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698