Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: chrome/browser/policy/schema_registry_service_factory.cc

Issue 2441653003: Enable fetching of admin policies for login screen apps (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698