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

Unified Diff: chrome/browser/policy/schema_registry_service_factory.cc

Issue 2739453004: Fix crash during sync load of the signin profile (Closed)
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/policy/profile_policy_connector_factory.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/schema_registry_service_factory.cc
diff --git a/chrome/browser/policy/schema_registry_service_factory.cc b/chrome/browser/policy/schema_registry_service_factory.cc
index 6c9fd50b43cc265bcabeb970a71404ad8108e030..6d72d85b2f2d16d6922409fb2d08c9d643e3d43f 100644
--- a/chrome/browser/policy/schema_registry_service_factory.cc
+++ b/chrome/browser/policy/schema_registry_service_factory.cc
@@ -18,6 +18,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_process_platform_part_chromeos.h"
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
+#include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h"
#include "chrome/browser/chromeos/policy/device_local_account_policy_service.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/profiles/profile.h"
@@ -123,6 +124,23 @@ SchemaRegistryServiceFactory::CreateForContextInternal(
if (!registry)
registry.reset(new SchemaRegistry);
+#if defined(OS_CHROMEOS)
+ Profile* const profile = Profile::FromBrowserContext(context);
+ if (chromeos::ProfileHelper::IsSigninProfile(profile)) {
+ // Pass the SchemaRegistry of the signin profile to device cloud policy
+ // manager, for being used for fetching the component policies.
+ policy::DeviceCloudPolicyManagerChromeOS* device_cloud_policy_manager =
+ g_browser_process->platform_part()
+ ->browser_policy_connector_chromeos()
+ ->GetDeviceCloudPolicyManager();
+ // TODO(tnagel): Do we need to do something for Active Directory management?
+ if (device_cloud_policy_manager) {
+ device_cloud_policy_manager->SetSigninProfileSchemaRegistry(
+ registry.get());
+ }
+ }
+#endif
+
std::unique_ptr<SchemaRegistryService> service(new SchemaRegistryService(
std::move(registry), chrome_schema, global_registry));
registries_[context] = service.get();
« no previous file with comments | « chrome/browser/policy/profile_policy_connector_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698