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/cloud/user_policy_signin_service_base.h" | 5 #include "chrome/browser/policy/cloud/user_policy_signin_service_base.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
11 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" | 11 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" |
12 #include "chrome/browser/signin/signin_manager.h" | 12 #include "chrome/browser/signin/signin_manager.h" |
13 #include "chrome/browser/signin/signin_manager_factory.h" | 13 #include "chrome/browser/signin/signin_manager_factory.h" |
| 14 #include "chrome/common/chrome_content_client.h" |
14 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
15 #include "components/policy/core/browser/browser_policy_connector.h" | 16 #include "components/policy/core/browser/browser_policy_connector.h" |
16 #include "components/policy/core/common/cloud/device_management_service.h" | 17 #include "components/policy/core/common/cloud/device_management_service.h" |
17 #include "components/policy/core/common/cloud/system_policy_request_context.h" | 18 #include "components/policy/core/common/cloud/system_policy_request_context.h" |
18 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" | 19 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" |
19 #include "components/policy/core/common/cloud/user_policy_request_context.h" | 20 #include "components/policy/core/common/cloud/user_policy_request_context.h" |
20 #include "content/public/browser/notification_source.h" | 21 #include "content/public/browser/notification_source.h" |
21 #include "content/public/common/content_client.h" | |
22 #include "net/url_request/url_request_context_getter.h" | 22 #include "net/url_request/url_request_context_getter.h" |
23 | 23 |
24 namespace policy { | 24 namespace policy { |
25 | 25 |
26 UserPolicySigninServiceBase::UserPolicySigninServiceBase( | 26 UserPolicySigninServiceBase::UserPolicySigninServiceBase( |
27 Profile* profile, | 27 Profile* profile, |
28 PrefService* local_state, | 28 PrefService* local_state, |
29 DeviceManagementService* device_management_service, | 29 DeviceManagementService* device_management_service, |
30 UserCloudPolicyManager* policy_manager, | 30 UserCloudPolicyManager* policy_manager, |
31 SigninManager* signin_manager, | 31 SigninManager* signin_manager, |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 void UserPolicySigninServiceBase::ShutdownUserCloudPolicyManager() { | 245 void UserPolicySigninServiceBase::ShutdownUserCloudPolicyManager() { |
246 PrepareForUserCloudPolicyManagerShutdown(); | 246 PrepareForUserCloudPolicyManagerShutdown(); |
247 UserCloudPolicyManager* manager = policy_manager(); | 247 UserCloudPolicyManager* manager = policy_manager(); |
248 if (manager) | 248 if (manager) |
249 manager->DisconnectAndRemovePolicy(); | 249 manager->DisconnectAndRemovePolicy(); |
250 } | 250 } |
251 | 251 |
252 scoped_refptr<net::URLRequestContextGetter> | 252 scoped_refptr<net::URLRequestContextGetter> |
253 UserPolicySigninServiceBase::CreateSystemRequestContext() { | 253 UserPolicySigninServiceBase::CreateSystemRequestContext() { |
254 return new SystemPolicyRequestContext( | 254 return new SystemPolicyRequestContext( |
255 system_request_context(), | 255 system_request_context(), GetUserAgent()); |
256 content::GetUserAgent(GURL(device_management_service_->GetServerUrl()))); | |
257 } | 256 } |
258 | 257 |
259 scoped_refptr<net::URLRequestContextGetter> | 258 scoped_refptr<net::URLRequestContextGetter> |
260 UserPolicySigninServiceBase::CreateUserRequestContext( | 259 UserPolicySigninServiceBase::CreateUserRequestContext( |
261 scoped_refptr<net::URLRequestContextGetter> profile_request_context) { | 260 scoped_refptr<net::URLRequestContextGetter> profile_request_context) { |
262 return new UserPolicyRequestContext( | 261 return new UserPolicyRequestContext( |
263 profile_request_context, | 262 profile_request_context, system_request_context(), GetUserAgent()); |
264 system_request_context(), | |
265 content::GetUserAgent(GURL(device_management_service_->GetServerUrl()))); | |
266 } | 263 } |
267 | 264 |
268 } // namespace policy | 265 } // namespace policy |
OLD | NEW |