schema_registry_service.h revision f2477e01787aa58f445919b809d89e252beef54f
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
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_POLICY_SCHEMA_REGISTRY_SERVICE_H_
6#define CHROME_BROWSER_POLICY_SCHEMA_REGISTRY_SERVICE_H_
7
8#include "base/basictypes.h"
9#include "base/compiler_specific.h"
10#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
11#include "components/policy/core/common/schema_registry.h"
12
13namespace policy {
14
15class Schema;
16
17// A SchemaRegistry that is also a BrowserContextKeyedService, and is associated
18// with a Profile.
19class SchemaRegistryService : public SchemaRegistry,
20                              public BrowserContextKeyedService {
21 public:
22  // This SchemaRegistry will initially contain only the |chrome_schema|, if
23  // it's valid. The optional |global_registry| must outlive this, and will
24  // track this registry.
25  SchemaRegistryService(const Schema& chrome_schema,
26                        CombinedSchemaRegistry* global_registry);
27  virtual ~SchemaRegistryService();
28
29  // BrowserContextKeyedService:
30  virtual void Shutdown() OVERRIDE;
31
32 private:
33  CombinedSchemaRegistry* global_registry_;
34
35  DISALLOW_COPY_AND_ASSIGN(SchemaRegistryService);
36};
37
38}  // namespace policy
39
40#endif  // CHROME_BROWSER_POLICY_SCHEMA_REGISTRY_SERVICE_H_
41