Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_POLICY_SCHEMA_REGISTRY_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_POLICY_SCHEMA_REGISTRY_SERVICE_H_ |
| 6 #define CHROME_BROWSER_POLICY_SCHEMA_REGISTRY_SERVICE_H_ | 6 #define CHROME_BROWSER_POLICY_SCHEMA_REGISTRY_SERVICE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
|
bartfab (slow)
2014/06/20 14:48:01
Nit: No longer needed.
Joao da Silva
2014/06/20 15:30:14
Done.
| |
| 10 #include "components/keyed_service/core/keyed_service.h" | 10 #include "components/keyed_service/core/keyed_service.h" |
| 11 #include "components/policy/core/common/schema_registry.h" | 11 #include "components/policy/core/common/schema_registry.h" |
|
bartfab (slow)
2014/06/20 14:48:01
Nit: A forward-declaration is sufficient now.
Joao da Silva
2014/06/20 15:30:14
Done.
| |
| 12 | 12 |
| 13 namespace policy { | 13 namespace policy { |
| 14 | 14 |
| 15 class Schema; | 15 class Schema; |
| 16 | 16 |
| 17 // A SchemaRegistry that is also a KeyedService, and is associated | 17 // A KeyedService associated with a Profile that contains a SchemaRegistry. |
| 18 // with a Profile. | 18 class SchemaRegistryService : public KeyedService { |
| 19 class SchemaRegistryService : public SchemaRegistry, public KeyedService { | |
| 20 public: | 19 public: |
| 21 // This SchemaRegistry will initially contain only the |chrome_schema|, if | 20 // This |registry| will initially contain only the |chrome_schema|, if |
| 22 // it's valid. The optional |global_registry| must outlive this, and will | 21 // it's valid. The optional |global_registry| must outlive this, and will |
| 23 // track this registry. | 22 // track |registry|. |
| 24 SchemaRegistryService(const Schema& chrome_schema, | 23 SchemaRegistryService(scoped_ptr<SchemaRegistry> registry, |
| 24 const Schema& chrome_schema, | |
| 25 CombinedSchemaRegistry* global_registry); | 25 CombinedSchemaRegistry* global_registry); |
| 26 virtual ~SchemaRegistryService(); | 26 virtual ~SchemaRegistryService(); |
| 27 | 27 |
| 28 // KeyedService: | 28 SchemaRegistry* registry() const { return registry_.get(); } |
| 29 virtual void Shutdown() OVERRIDE; | |
| 30 | 29 |
| 31 private: | 30 private: |
| 32 CombinedSchemaRegistry* global_registry_; | 31 scoped_ptr<SchemaRegistry> registry_; |
|
bartfab (slow)
2014/06/20 14:48:01
Nit: #include "base/memory/scoped_ptr.h"
Joao da Silva
2014/06/20 15:30:14
Done.
| |
| 33 | 32 |
| 34 DISALLOW_COPY_AND_ASSIGN(SchemaRegistryService); | 33 DISALLOW_COPY_AND_ASSIGN(SchemaRegistryService); |
| 35 }; | 34 }; |
| 36 | 35 |
| 37 } // namespace policy | 36 } // namespace policy |
| 38 | 37 |
| 39 #endif // CHROME_BROWSER_POLICY_SCHEMA_REGISTRY_SERVICE_H_ | 38 #endif // CHROME_BROWSER_POLICY_SCHEMA_REGISTRY_SERVICE_H_ |
| OLD | NEW |