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

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

Issue 99333002: Revert of Move ConfigurationPolicyProvider, etc. to components/policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "components/policy/core/common/configuration_policy_provider.h"
6
7 #include "base/callback.h"
8 #include "components/policy/core/common/external_data_fetcher.h"
9 #include "components/policy/core/common/policy_map.h"
10
11 namespace policy {
12
13 ConfigurationPolicyProvider::Observer::~Observer() {}
14
15 ConfigurationPolicyProvider::ConfigurationPolicyProvider()
16 : did_shutdown_(false),
17 schema_registry_(NULL) {}
18
19 ConfigurationPolicyProvider::~ConfigurationPolicyProvider() {
20 DCHECK(did_shutdown_);
21 }
22
23 void ConfigurationPolicyProvider::Init(SchemaRegistry* registry) {
24 schema_registry_ = registry;
25 schema_registry_->AddObserver(this);
26 }
27
28 void ConfigurationPolicyProvider::Shutdown() {
29 did_shutdown_ = true;
30 if (schema_registry_) {
31 // Unit tests don't initialize the BrowserPolicyConnector but call
32 // shutdown; handle that.
33 schema_registry_->RemoveObserver(this);
34 schema_registry_ = NULL;
35 }
36 }
37
38 bool ConfigurationPolicyProvider::IsInitializationComplete(
39 PolicyDomain domain) const {
40 return true;
41 }
42
43 void ConfigurationPolicyProvider::UpdatePolicy(
44 scoped_ptr<PolicyBundle> bundle) {
45 if (bundle.get())
46 policy_bundle_.Swap(bundle.get());
47 else
48 policy_bundle_.Clear();
49 FOR_EACH_OBSERVER(ConfigurationPolicyProvider::Observer,
50 observer_list_,
51 OnUpdatePolicy(this));
52 }
53
54 SchemaRegistry* ConfigurationPolicyProvider::schema_registry() const {
55 return schema_registry_;
56 }
57
58 const scoped_refptr<SchemaMap>&
59 ConfigurationPolicyProvider::schema_map() const {
60 return schema_registry_->schema_map();
61 }
62
63 void ConfigurationPolicyProvider::AddObserver(Observer* observer) {
64 observer_list_.AddObserver(observer);
65 }
66
67 void ConfigurationPolicyProvider::RemoveObserver(Observer* observer) {
68 observer_list_.RemoveObserver(observer);
69 }
70
71 void ConfigurationPolicyProvider::OnSchemaRegistryUpdated(
72 bool has_new_schemas) {}
73
74 void ConfigurationPolicyProvider::OnSchemaRegistryReady() {}
75
76 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698