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 #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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 } | 120 } |
| 121 #endif | 121 #endif |
| 122 | 122 |
| 123 if (!registry) | 123 if (!registry) |
| 124 registry.reset(new SchemaRegistry); | 124 registry.reset(new SchemaRegistry); |
| 125 | 125 |
| 126 #if defined(OS_CHROMEOS) | |
| 127 Profile* const profile = Profile::FromBrowserContext(context); | |
| 128 if (chromeos::ProfileHelper::IsSigninProfile(profile)) { | |
| 129 // Pass the SchemaRegistry of the signin profile to device cloud policy | |
| 130 // manager, for being used for fetching the component policies. | |
| 131 policy::DeviceCloudPolicyManagerChromeOS* device_cloud_policy_manager = | |
|
bartfab (slow)
2017/03/03 17:31:28
Nit: #include "chrome/browser/chromeos/policy/devi
emaxx
2017/03/03 17:42:09
Done.
| |
| 132 g_browser_process->platform_part() | |
| 133 ->browser_policy_connector_chromeos() | |
| 134 ->GetDeviceCloudPolicyManager(); | |
| 135 // TODO(tnagel): Do we need to do something for Active Directory management? | |
| 136 if (device_cloud_policy_manager) { | |
| 137 device_cloud_policy_manager->SetSigninProfileSchemaRegistry( | |
| 138 registry.get()); | |
| 139 } | |
| 140 } | |
| 141 #endif | |
| 142 | |
| 126 std::unique_ptr<SchemaRegistryService> service(new SchemaRegistryService( | 143 std::unique_ptr<SchemaRegistryService> service(new SchemaRegistryService( |
| 127 std::move(registry), chrome_schema, global_registry)); | 144 std::move(registry), chrome_schema, global_registry)); |
| 128 registries_[context] = service.get(); | 145 registries_[context] = service.get(); |
| 129 return service; | 146 return service; |
| 130 } | 147 } |
| 131 | 148 |
| 132 void SchemaRegistryServiceFactory::BrowserContextShutdown( | 149 void SchemaRegistryServiceFactory::BrowserContextShutdown( |
| 133 content::BrowserContext* context) { | 150 content::BrowserContext* context) { |
| 134 if (context->IsOffTheRecord()) | 151 if (context->IsOffTheRecord()) |
| 135 return; | 152 return; |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 151 | 168 |
| 152 bool SchemaRegistryServiceFactory::HasTestingFactory( | 169 bool SchemaRegistryServiceFactory::HasTestingFactory( |
| 153 content::BrowserContext* context) { | 170 content::BrowserContext* context) { |
| 154 return false; | 171 return false; |
| 155 } | 172 } |
| 156 | 173 |
| 157 void SchemaRegistryServiceFactory::CreateServiceNow( | 174 void SchemaRegistryServiceFactory::CreateServiceNow( |
| 158 content::BrowserContext* context) {} | 175 content::BrowserContext* context) {} |
| 159 | 176 |
| 160 } // namespace policy | 177 } // namespace policy |
| OLD | NEW |