| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/policy/user_cloud_policy_manager_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 void UserCloudPolicyManagerChromeOS::Connect( | 106 void UserCloudPolicyManagerChromeOS::Connect( |
| 107 PrefService* local_state, | 107 PrefService* local_state, |
| 108 DeviceManagementService* device_management_service, | 108 DeviceManagementService* device_management_service, |
| 109 scoped_refptr<net::URLRequestContextGetter> system_request_context, | 109 scoped_refptr<net::URLRequestContextGetter> system_request_context, |
| 110 UserAffiliation user_affiliation) { | 110 UserAffiliation user_affiliation) { |
| 111 DCHECK(device_management_service); | 111 DCHECK(device_management_service); |
| 112 DCHECK(local_state); | 112 DCHECK(local_state); |
| 113 local_state_ = local_state; | 113 local_state_ = local_state; |
| 114 scoped_refptr<net::URLRequestContextGetter> request_context; | 114 scoped_refptr<net::URLRequestContextGetter> request_context; |
| 115 if (system_request_context) { | 115 if (system_request_context.get()) { |
| 116 // |system_request_context| can be null for tests. | 116 // |system_request_context| can be null for tests. |
| 117 // Use the system request context here instead of a context derived | 117 // Use the system request context here instead of a context derived |
| 118 // from the Profile because Connect() is called before the profile is | 118 // from the Profile because Connect() is called before the profile is |
| 119 // fully initialized (required so we can perform the initial policy load). | 119 // fully initialized (required so we can perform the initial policy load). |
| 120 // TODO(atwilson): Change this to use a UserPolicyRequestContext once | 120 // TODO(atwilson): Change this to use a UserPolicyRequestContext once |
| 121 // Connect() is called after profile initialization. http://crbug.com/323591 | 121 // Connect() is called after profile initialization. http://crbug.com/323591 |
| 122 request_context = new SystemPolicyRequestContext( | 122 request_context = new SystemPolicyRequestContext( |
| 123 system_request_context, GetUserAgent()); | 123 system_request_context, GetUserAgent()); |
| 124 } | 124 } |
| 125 scoped_ptr<CloudPolicyClient> cloud_policy_client( | 125 scoped_ptr<CloudPolicyClient> cloud_policy_client( |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 // OnComponentCloudPolicyUpdated() once it's ready. | 386 // OnComponentCloudPolicyUpdated() once it's ready. |
| 387 return; | 387 return; |
| 388 } | 388 } |
| 389 | 389 |
| 390 core()->StartRefreshScheduler(); | 390 core()->StartRefreshScheduler(); |
| 391 core()->TrackRefreshDelayPref(local_state_, | 391 core()->TrackRefreshDelayPref(local_state_, |
| 392 policy_prefs::kUserPolicyRefreshRate); | 392 policy_prefs::kUserPolicyRefreshRate); |
| 393 } | 393 } |
| 394 | 394 |
| 395 } // namespace policy | 395 } // namespace policy |
| OLD | NEW |