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" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
|
bartfab (slow)
2017/03/03 17:31:28
Nit: No longer used.
emaxx
2017/03/03 17:42:09
Done.
| |
| 13 #include "chrome/browser/policy/profile_policy_connector.h" | 13 #include "chrome/browser/policy/profile_policy_connector.h" |
| 14 #include "chrome/browser/policy/schema_registry_service.h" | 14 #include "chrome/browser/policy/schema_registry_service.h" |
| 15 #include "chrome/browser/policy/schema_registry_service_factory.h" | 15 #include "chrome/browser/policy/schema_registry_service_factory.h" |
| 16 #include "chrome/browser/profiles/incognito_helpers.h" | 16 #include "chrome/browser/profiles/incognito_helpers.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 18 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 18 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 19 #include "components/policy/core/common/policy_service.h" | 19 #include "components/policy/core/common/policy_service.h" |
| 20 #include "components/policy/core/common/policy_service_impl.h" | 20 #include "components/policy/core/common/policy_service_impl.h" |
| 21 | 21 |
| 22 #if defined(OS_CHROMEOS) | 22 #if defined(OS_CHROMEOS) |
| 23 #include "chrome/browser/chromeos/policy/active_directory_policy_manager.h" | 23 #include "chrome/browser/chromeos/policy/active_directory_policy_manager.h" |
| 24 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 24 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
|
bartfab (slow)
2017/03/03 17:31:28
Nit: No longer used.
emaxx
2017/03/03 17:42:09
Done.
| |
| 25 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" | 25 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" |
|
bartfab (slow)
2017/03/03 17:31:28
Nit: No longer used.
emaxx
2017/03/03 17:42:09
Done.
| |
| 26 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" | 26 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" |
| 27 #include "chrome/browser/chromeos/policy/user_policy_manager_factory_chromeos.h" | 27 #include "chrome/browser/chromeos/policy/user_policy_manager_factory_chromeos.h" |
| 28 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 28 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 29 #include "components/user_manager/user.h" | 29 #include "components/user_manager/user.h" |
| 30 #else // Non-ChromeOS. | 30 #else // Non-ChromeOS. |
| 31 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" | 31 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" |
| 32 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" | 32 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" |
| 33 #endif | 33 #endif |
| 34 | 34 |
| 35 namespace policy { | 35 namespace policy { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 103 | 103 |
| 104 const user_manager::User* user = nullptr; | 104 const user_manager::User* user = nullptr; |
| 105 SchemaRegistry* schema_registry = | 105 SchemaRegistry* schema_registry = |
| 106 SchemaRegistryServiceFactory::GetForContext(context)->registry(); | 106 SchemaRegistryServiceFactory::GetForContext(context)->registry(); |
| 107 | 107 |
| 108 ConfigurationPolicyProvider* policy_provider = nullptr; | 108 ConfigurationPolicyProvider* policy_provider = nullptr; |
| 109 const CloudPolicyStore* policy_store = nullptr; | 109 const CloudPolicyStore* policy_store = nullptr; |
| 110 | 110 |
| 111 #if defined(OS_CHROMEOS) | 111 #if defined(OS_CHROMEOS) |
| 112 Profile* const profile = Profile::FromBrowserContext(context); | 112 Profile* const profile = Profile::FromBrowserContext(context); |
| 113 if (chromeos::ProfileHelper::IsSigninProfile(profile)) { | 113 if (!chromeos::ProfileHelper::IsSigninProfile(profile)) { |
| 114 policy::DeviceCloudPolicyManagerChromeOS* device_cloud_policy_manager = | |
| 115 g_browser_process->platform_part() | |
| 116 ->browser_policy_connector_chromeos() | |
| 117 ->GetDeviceCloudPolicyManager(); | |
| 118 // TODO(tnagel): Do we need to do something for Active Directory management? | |
| 119 if (device_cloud_policy_manager) { | |
| 120 device_cloud_policy_manager->SetSigninProfileSchemaRegistry( | |
| 121 schema_registry); | |
| 122 } | |
| 123 } else { | |
| 124 user = chromeos::ProfileHelper::Get()->GetUserByProfile(profile); | 114 user = chromeos::ProfileHelper::Get()->GetUserByProfile(profile); |
| 125 CHECK(user); | 115 CHECK(user); |
| 126 } | 116 } |
| 127 | 117 |
| 128 CloudPolicyManager* user_cloud_policy_manager = | 118 CloudPolicyManager* user_cloud_policy_manager = |
| 129 UserPolicyManagerFactoryChromeOS::GetCloudPolicyManagerForProfile( | 119 UserPolicyManagerFactoryChromeOS::GetCloudPolicyManagerForProfile( |
| 130 profile); | 120 profile); |
| 131 ActiveDirectoryPolicyManager* active_directory_manager = | 121 ActiveDirectoryPolicyManager* active_directory_manager = |
| 132 UserPolicyManagerFactoryChromeOS:: | 122 UserPolicyManagerFactoryChromeOS:: |
| 133 GetActiveDirectoryPolicyManagerForProfile(profile); | 123 GetActiveDirectoryPolicyManagerForProfile(profile); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 187 | 177 |
| 188 bool ProfilePolicyConnectorFactory::HasTestingFactory( | 178 bool ProfilePolicyConnectorFactory::HasTestingFactory( |
| 189 content::BrowserContext* context) { | 179 content::BrowserContext* context) { |
| 190 return false; | 180 return false; |
| 191 } | 181 } |
| 192 | 182 |
| 193 void ProfilePolicyConnectorFactory::CreateServiceNow( | 183 void ProfilePolicyConnectorFactory::CreateServiceNow( |
| 194 content::BrowserContext* context) {} | 184 content::BrowserContext* context) {} |
| 195 | 185 |
| 196 } // namespace policy | 186 } // namespace policy |
| OLD | NEW |