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#include "chrome/browser/policy/schema_registry_service.h"
6
7#include "components/policy/core/common/policy_namespace.h"
8#include "components/policy/core/common/schema.h"
9#include "components/policy/core/common/schema_registry.h"
10
11namespace policy {
12
13SchemaRegistryService::SchemaRegistryService(
14    scoped_ptr<SchemaRegistry> registry,
15    const Schema& chrome_schema,
16    CombinedSchemaRegistry* global_registry)
17    : registry_(registry.Pass()) {
18  if (chrome_schema.valid()) {
19    registry_->RegisterComponent(PolicyNamespace(POLICY_DOMAIN_CHROME, ""),
20                                 chrome_schema);
21  }
22  registry_->SetReady(POLICY_DOMAIN_CHROME);
23  if (global_registry)
24    global_registry->Track(registry_.get());
25}
26
27SchemaRegistryService::~SchemaRegistryService() {}
28
29}  // namespace policy
30