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

Unified Diff: chrome/browser/policy/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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/policy/configuration_policy_provider.cc
diff --git a/chrome/browser/policy/configuration_policy_provider.cc b/chrome/browser/policy/configuration_policy_provider.cc
new file mode 100644
index 0000000000000000000000000000000000000000..10374fc1c4c3095336960d39eac4db1ad1dd2898
--- /dev/null
+++ b/chrome/browser/policy/configuration_policy_provider.cc
@@ -0,0 +1,76 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/policy/configuration_policy_provider.h"
+
+#include "base/callback.h"
+#include "components/policy/core/common/external_data_fetcher.h"
+#include "components/policy/core/common/policy_map.h"
+
+namespace policy {
+
+ConfigurationPolicyProvider::Observer::~Observer() {}
+
+ConfigurationPolicyProvider::ConfigurationPolicyProvider()
+ : did_shutdown_(false),
+ schema_registry_(NULL) {}
+
+ConfigurationPolicyProvider::~ConfigurationPolicyProvider() {
+ DCHECK(did_shutdown_);
+}
+
+void ConfigurationPolicyProvider::Init(SchemaRegistry* registry) {
+ schema_registry_ = registry;
+ schema_registry_->AddObserver(this);
+}
+
+void ConfigurationPolicyProvider::Shutdown() {
+ did_shutdown_ = true;
+ if (schema_registry_) {
+ // Unit tests don't initialize the BrowserPolicyConnector but call
+ // shutdown; handle that.
+ schema_registry_->RemoveObserver(this);
+ schema_registry_ = NULL;
+ }
+}
+
+bool ConfigurationPolicyProvider::IsInitializationComplete(
+ PolicyDomain domain) const {
+ return true;
+}
+
+void ConfigurationPolicyProvider::UpdatePolicy(
+ scoped_ptr<PolicyBundle> bundle) {
+ if (bundle.get())
+ policy_bundle_.Swap(bundle.get());
+ else
+ policy_bundle_.Clear();
+ FOR_EACH_OBSERVER(ConfigurationPolicyProvider::Observer,
+ observer_list_,
+ OnUpdatePolicy(this));
+}
+
+SchemaRegistry* ConfigurationPolicyProvider::schema_registry() const {
+ return schema_registry_;
+}
+
+const scoped_refptr<SchemaMap>&
+ConfigurationPolicyProvider::schema_map() const {
+ return schema_registry_->schema_map();
+}
+
+void ConfigurationPolicyProvider::AddObserver(Observer* observer) {
+ observer_list_.AddObserver(observer);
+}
+
+void ConfigurationPolicyProvider::RemoveObserver(Observer* observer) {
+ observer_list_.RemoveObserver(observer);
+}
+
+void ConfigurationPolicyProvider::OnSchemaRegistryUpdated(
+ bool has_new_schemas) {}
+
+void ConfigurationPolicyProvider::OnSchemaRegistryReady() {}
+
+} // namespace policy
« no previous file with comments | « chrome/browser/policy/configuration_policy_provider.h ('k') | chrome/browser/policy/configuration_policy_provider_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698