Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.cc

Issue 116273002: Added support for signed policy blobs on desktop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup from self-review + cros clang fix. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/device_cloud_policy_manager_chromeos.h" 5 #include "chrome/browser/chromeos/policy/device_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/prefs/pref_registry_simple.h" 9 #include "base/prefs/pref_registry_simple.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } // namespace 87 } // namespace
88 88
89 DeviceCloudPolicyManagerChromeOS::DeviceCloudPolicyManagerChromeOS( 89 DeviceCloudPolicyManagerChromeOS::DeviceCloudPolicyManagerChromeOS(
90 scoped_ptr<DeviceCloudPolicyStoreChromeOS> store, 90 scoped_ptr<DeviceCloudPolicyStoreChromeOS> store,
91 const scoped_refptr<base::SequencedTaskRunner>& task_runner, 91 const scoped_refptr<base::SequencedTaskRunner>& task_runner,
92 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, 92 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner,
93 EnterpriseInstallAttributes* install_attributes) 93 EnterpriseInstallAttributes* install_attributes)
94 : CloudPolicyManager( 94 : CloudPolicyManager(
95 PolicyNamespaceKey(dm_protocol::kChromeDevicePolicyType, 95 PolicyNamespaceKey(dm_protocol::kChromeDevicePolicyType,
96 std::string()), 96 std::string()),
97 kPolicyVerificationKeyHash,
97 store.get(), 98 store.get(),
98 task_runner, 99 task_runner,
99 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), 100 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE),
100 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)), 101 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)),
101 device_store_(store.Pass()), 102 device_store_(store.Pass()),
102 background_task_runner_(background_task_runner), 103 background_task_runner_(background_task_runner),
103 install_attributes_(install_attributes), 104 install_attributes_(install_attributes),
104 device_management_service_(NULL), 105 device_management_service_(NULL),
105 local_state_(NULL) {} 106 local_state_(NULL) {}
106 107
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 245
245 scoped_ptr<CloudPolicyClient> DeviceCloudPolicyManagerChromeOS::CreateClient() { 246 scoped_ptr<CloudPolicyClient> DeviceCloudPolicyManagerChromeOS::CreateClient() {
246 scoped_refptr<net::URLRequestContextGetter> request_context = 247 scoped_refptr<net::URLRequestContextGetter> request_context =
247 new SystemPolicyRequestContext( 248 new SystemPolicyRequestContext(
248 g_browser_process->system_request_context(), 249 g_browser_process->system_request_context(),
249 content::GetUserAgent(GURL( 250 content::GetUserAgent(GURL(
250 device_management_service_->GetServerUrl()))); 251 device_management_service_->GetServerUrl())));
251 252
252 return make_scoped_ptr( 253 return make_scoped_ptr(
253 new CloudPolicyClient(GetMachineID(), GetMachineModel(), 254 new CloudPolicyClient(GetMachineID(), GetMachineModel(),
255 kPolicyVerificationKeyHash,
254 USER_AFFILIATION_NONE, 256 USER_AFFILIATION_NONE,
255 device_status_provider_.get(), 257 device_status_provider_.get(),
256 device_management_service_, 258 device_management_service_,
257 request_context)); 259 request_context));
258 } 260 }
259 261
260 void DeviceCloudPolicyManagerChromeOS::EnrollmentCompleted( 262 void DeviceCloudPolicyManagerChromeOS::EnrollmentCompleted(
261 const EnrollmentCallback& callback, 263 const EnrollmentCallback& callback,
262 EnrollmentStatus status) { 264 EnrollmentStatus status) {
263 if (status.status() == EnrollmentStatus::STATUS_SUCCESS) { 265 if (status.status() == EnrollmentStatus::STATUS_SUCCESS) {
(...skipping 21 matching lines...) Expand all
285 core()->Connect(CreateClient()); 287 core()->Connect(CreateClient());
286 core()->StartRefreshScheduler(); 288 core()->StartRefreshScheduler();
287 core()->TrackRefreshDelayPref(local_state_, 289 core()->TrackRefreshDelayPref(local_state_,
288 prefs::kDevicePolicyRefreshRate); 290 prefs::kDevicePolicyRefreshRate);
289 attestation_policy_observer_.reset( 291 attestation_policy_observer_.reset(
290 new chromeos::attestation::AttestationPolicyObserver(client())); 292 new chromeos::attestation::AttestationPolicyObserver(client()));
291 } 293 }
292 } 294 }
293 295
294 } // namespace policy 296 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698