Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/profile_policy_connector_factory.h" | 5 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 103 SchemaRegistry* schema_registry = nullptr; | 103 SchemaRegistry* schema_registry = nullptr; |
| 104 CloudPolicyManager* user_cloud_policy_manager = nullptr; | 104 CloudPolicyManager* user_cloud_policy_manager = nullptr; |
| 105 | 105 |
| 106 schema_registry = | 106 schema_registry = |
| 107 SchemaRegistryServiceFactory::GetForContext(context)->registry(); | 107 SchemaRegistryServiceFactory::GetForContext(context)->registry(); |
| 108 | 108 |
| 109 #if defined(OS_CHROMEOS) | 109 #if defined(OS_CHROMEOS) |
| 110 Profile* const profile = Profile::FromBrowserContext(context); | 110 Profile* const profile = Profile::FromBrowserContext(context); |
| 111 const user_manager::User* user = nullptr; | 111 const user_manager::User* user = nullptr; |
| 112 if (chromeos::ProfileHelper::IsSigninProfile(profile)) { | 112 if (chromeos::ProfileHelper::IsSigninProfile(profile)) { |
| 113 policy::BrowserPolicyConnectorChromeOS* browser_policy_connector = | |
| 114 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | |
| 115 policy::DeviceCloudPolicyManagerChromeOS* device_cloud_policy_manager = | 113 policy::DeviceCloudPolicyManagerChromeOS* device_cloud_policy_manager = |
| 116 browser_policy_connector->GetDeviceCloudPolicyManager(); | 114 g_browser_process->platform_part() |
| 117 device_cloud_policy_manager->SetSigninProfileSchemaRegistry( | 115 ->browser_policy_connector_chromeos() |
| 118 schema_registry); | 116 ->GetDeviceCloudPolicyManager(); |
| 117 // TODO(tnagel): Do we need to do something for Active Directory management? | |
|
emaxx
2016/11/17 01:14:32
This piece was solely for supporting cloud policy
| |
| 118 if (device_cloud_policy_manager) { | |
| 119 device_cloud_policy_manager->SetSigninProfileSchemaRegistry( | |
| 120 schema_registry); | |
| 121 } | |
| 119 } else { | 122 } else { |
| 120 user = chromeos::ProfileHelper::Get()->GetUserByProfile(profile); | 123 user = chromeos::ProfileHelper::Get()->GetUserByProfile(profile); |
| 121 CHECK(user); | 124 CHECK(user); |
| 122 } | 125 } |
| 123 user_cloud_policy_manager = | 126 user_cloud_policy_manager = |
| 124 UserCloudPolicyManagerFactoryChromeOS::GetForProfile(profile); | 127 UserCloudPolicyManagerFactoryChromeOS::GetForProfile(profile); |
| 125 #else | 128 #else |
| 126 user_cloud_policy_manager = | 129 user_cloud_policy_manager = |
| 127 UserCloudPolicyManagerFactory::GetForBrowserContext(context); | 130 UserCloudPolicyManagerFactory::GetForBrowserContext(context); |
| 128 #endif // defined(OS_CHROMEOS) | 131 #endif // defined(OS_CHROMEOS) |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 170 | 173 |
| 171 bool ProfilePolicyConnectorFactory::HasTestingFactory( | 174 bool ProfilePolicyConnectorFactory::HasTestingFactory( |
| 172 content::BrowserContext* context) { | 175 content::BrowserContext* context) { |
| 173 return false; | 176 return false; |
| 174 } | 177 } |
| 175 | 178 |
| 176 void ProfilePolicyConnectorFactory::CreateServiceNow( | 179 void ProfilePolicyConnectorFactory::CreateServiceNow( |
| 177 content::BrowserContext* context) {} | 180 content::BrowserContext* context) {} |
| 178 | 181 |
| 179 } // namespace policy | 182 } // namespace policy |
| OLD | NEW |