| OLD | NEW |
| 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 "chrome/browser/policy/schema_registry_service.h" | 5 #include "chrome/browser/policy/schema_registry_service.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "components/policy/core/common/policy_namespace.h" | 8 #include "components/policy/core/common/policy_namespace.h" |
| 9 #include "components/policy/core/common/schema.h" | 9 #include "components/policy/core/common/schema.h" |
| 10 | 10 |
| 11 namespace policy { | 11 namespace policy { |
| 12 | 12 |
| 13 SchemaRegistryService::SchemaRegistryService( | 13 SchemaRegistryService::SchemaRegistryService( |
| 14 const Schema& chrome_schema, | 14 const Schema& chrome_schema, |
| 15 CombinedSchemaRegistry* global_registry) | 15 CombinedSchemaRegistry* global_registry) |
| 16 : global_registry_(global_registry) { | 16 : global_registry_(global_registry) { |
| 17 if (chrome_schema.valid()) | 17 if (chrome_schema.valid()) |
| 18 RegisterComponent(PolicyNamespace(POLICY_DOMAIN_CHROME, ""), chrome_schema); | 18 RegisterComponent(PolicyNamespace(POLICY_DOMAIN_CHROME, ""), chrome_schema); |
| 19 SetReady(POLICY_DOMAIN_CHROME); |
| 19 if (global_registry_) | 20 if (global_registry_) |
| 20 global_registry->Track(this); | 21 global_registry->Track(this); |
| 21 } | 22 } |
| 22 | 23 |
| 23 SchemaRegistryService::~SchemaRegistryService() {} | 24 SchemaRegistryService::~SchemaRegistryService() {} |
| 24 | 25 |
| 25 void SchemaRegistryService::Shutdown() { | 26 void SchemaRegistryService::Shutdown() { |
| 26 if (global_registry_) { | 27 if (global_registry_) { |
| 27 global_registry_->Untrack(this); | 28 global_registry_->Untrack(this); |
| 28 global_registry_ = NULL; | 29 global_registry_ = NULL; |
| 29 } | 30 } |
| 30 DCHECK(!HasObservers()); | 31 DCHECK(!HasObservers()); |
| 31 } | 32 } |
| 32 | 33 |
| 33 } // namespace policy | 34 } // namespace policy |
| OLD | NEW |