| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 if (system_request_context) { | 93 if (system_request_context) { |
| 94 // |system_request_context| can be null for tests. | 94 // |system_request_context| can be null for tests. |
| 95 // Use the system request context here instead of a context derived | 95 // Use the system request context here instead of a context derived |
| 96 // from the Profile because Connect() is called before the profile is | 96 // from the Profile because Connect() is called before the profile is |
| 97 // fully initialized (required so we can perform the initial policy load). | 97 // fully initialized (required so we can perform the initial policy load). |
| 98 // TODO(atwilson): Change this to use a UserPolicyRequestContext once | 98 // TODO(atwilson): Change this to use a UserPolicyRequestContext once |
| 99 // Connect() is called after profile initialization. http://crbug.com/323591 | 99 // Connect() is called after profile initialization. http://crbug.com/323591 |
| 100 request_context = new SystemPolicyRequestContext( | 100 request_context = new SystemPolicyRequestContext( |
| 101 system_request_context, | 101 system_request_context, |
| 102 content::GetUserAgent(GURL( | 102 content::GetUserAgent(GURL( |
| 103 device_management_service->GetServerURL()))); | 103 device_management_service->GetServerUrl()))); |
| 104 } | 104 } |
| 105 scoped_ptr<CloudPolicyClient> cloud_policy_client( | 105 scoped_ptr<CloudPolicyClient> cloud_policy_client( |
| 106 new CloudPolicyClient(std::string(), std::string(), user_affiliation, | 106 new CloudPolicyClient(std::string(), std::string(), user_affiliation, |
| 107 NULL, device_management_service, | 107 NULL, device_management_service, |
| 108 request_context)); | 108 request_context)); |
| 109 core()->Connect(cloud_policy_client.Pass()); | 109 core()->Connect(cloud_policy_client.Pass()); |
| 110 client()->AddObserver(this); | 110 client()->AddObserver(this); |
| 111 | 111 |
| 112 external_data_manager_->Connect(request_context); | 112 external_data_manager_->Connect(request_context); |
| 113 | 113 |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 // OnComponentCloudPolicyUpdated() once it's ready. | 331 // OnComponentCloudPolicyUpdated() once it's ready. |
| 332 return; | 332 return; |
| 333 } | 333 } |
| 334 | 334 |
| 335 core()->StartRefreshScheduler(); | 335 core()->StartRefreshScheduler(); |
| 336 core()->TrackRefreshDelayPref(local_state_, | 336 core()->TrackRefreshDelayPref(local_state_, |
| 337 policy_prefs::kUserPolicyRefreshRate); | 337 policy_prefs::kUserPolicyRefreshRate); |
| 338 } | 338 } |
| 339 | 339 |
| 340 } // namespace policy | 340 } // namespace policy |
| OLD | NEW |