schema_registry_service.h revision 6d86b77056ed63eb6871182f42a9fd5f07550f90
1f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved.
2f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
3f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// found in the LICENSE file.
4f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
5f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#ifndef CHROME_BROWSER_POLICY_SCHEMA_REGISTRY_SERVICE_H_
6f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#define CHROME_BROWSER_POLICY_SCHEMA_REGISTRY_SERVICE_H_
7f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
8f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#include "base/basictypes.h"
96d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)#include "base/memory/scoped_ptr.h"
10a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#include "components/keyed_service/core/keyed_service.h"
11f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
12f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)namespace policy {
13f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
146d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)class CombinedSchemaRegistry;
15f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)class Schema;
166d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)class SchemaRegistry;
17f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
186d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)// A KeyedService associated with a Profile that contains a SchemaRegistry.
196d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)class SchemaRegistryService : public KeyedService {
20f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) public:
216d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)  // This |registry| will initially contain only the |chrome_schema|, if
22f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  // it's valid. The optional |global_registry| must outlive this, and will
236d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)  // track |registry|.
246d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)  SchemaRegistryService(scoped_ptr<SchemaRegistry> registry,
256d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)                        const Schema& chrome_schema,
26f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)                        CombinedSchemaRegistry* global_registry);
27f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  virtual ~SchemaRegistryService();
28f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
296d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)  SchemaRegistry* registry() const { return registry_.get(); }
30f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
31f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) private:
326d86b77056ed63eb6871182f42a9fd5f07550f90Torne (Richard Coles)  scoped_ptr<SchemaRegistry> registry_;
33f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
34f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(SchemaRegistryService);
35f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)};
36f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
37f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)}  // namespace policy
38f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
39f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#endif  // CHROME_BROWSER_POLICY_SCHEMA_REGISTRY_SERVICE_H_
40