| 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_factory.h" | 5 #include "chrome/browser/policy/schema_registry_service_factory.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 std::unique_ptr<SchemaRegistry> registry; | 110 std::unique_ptr<SchemaRegistry> registry; |
| 111 | 111 |
| 112 #if defined(OS_CHROMEOS) | 112 #if defined(OS_CHROMEOS) |
| 113 DeviceLocalAccountPolicyBroker* broker = GetBroker(context); | 113 DeviceLocalAccountPolicyBroker* broker = GetBroker(context); |
| 114 if (broker) { | 114 if (broker) { |
| 115 // The SchemaRegistry for a device-local account is owned by its | 115 // The SchemaRegistry for a device-local account is owned by its |
| 116 // DeviceLocalAccountPolicyBroker, which uses the registry to fetch and | 116 // DeviceLocalAccountPolicyBroker, which uses the registry to fetch and |
| 117 // cache policy even if there is no active session for that account. | 117 // cache policy even if there is no active session for that account. |
| 118 // Use a ForwardingSchemaRegistry that wraps this SchemaRegistry. | 118 // Use a ForwardingSchemaRegistry that wraps this SchemaRegistry. |
| 119 registry.reset(new ForwardingSchemaRegistry(broker->schema_registry())); | 119 registry.reset(new ForwardingSchemaRegistry(broker->schema_registry(), |
| 120 false /* forward_readiness */)); |
| 120 } | 121 } |
| 121 #endif | 122 #endif |
| 122 | 123 |
| 123 if (!registry) | 124 if (!registry) |
| 124 registry.reset(new SchemaRegistry); | 125 registry.reset(new SchemaRegistry); |
| 125 | 126 |
| 126 std::unique_ptr<SchemaRegistryService> service(new SchemaRegistryService( | 127 std::unique_ptr<SchemaRegistryService> service(new SchemaRegistryService( |
| 127 std::move(registry), chrome_schema, global_registry)); | 128 std::move(registry), chrome_schema, global_registry)); |
| 128 registries_[context] = service.get(); | 129 registries_[context] = service.get(); |
| 129 return service; | 130 return service; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 151 | 152 |
| 152 bool SchemaRegistryServiceFactory::HasTestingFactory( | 153 bool SchemaRegistryServiceFactory::HasTestingFactory( |
| 153 content::BrowserContext* context) { | 154 content::BrowserContext* context) { |
| 154 return false; | 155 return false; |
| 155 } | 156 } |
| 156 | 157 |
| 157 void SchemaRegistryServiceFactory::CreateServiceNow( | 158 void SchemaRegistryServiceFactory::CreateServiceNow( |
| 158 content::BrowserContext* context) {} | 159 content::BrowserContext* context) {} |
| 159 | 160 |
| 160 } // namespace policy | 161 } // namespace policy |
| OLD | NEW |