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

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

Issue 2261763002: Device enterprise registration with a certificate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initialize pointers to nullptr. Created 4 years, 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_initializer.h" 5 #include "chrome/browser/chromeos/policy/device_cloud_policy_initializer.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 if (!enrollment_callback.is_null()) 245 if (!enrollment_callback.is_null())
246 enrollment_callback.Run(status); 246 enrollment_callback.Run(status);
247 } 247 }
248 248
249 std::unique_ptr<CloudPolicyClient> DeviceCloudPolicyInitializer::CreateClient( 249 std::unique_ptr<CloudPolicyClient> DeviceCloudPolicyInitializer::CreateClient(
250 DeviceManagementService* device_management_service) { 250 DeviceManagementService* device_management_service) {
251 return base::MakeUnique<CloudPolicyClient>( 251 return base::MakeUnique<CloudPolicyClient>(
252 DeviceCloudPolicyManagerChromeOS::GetMachineID(), 252 DeviceCloudPolicyManagerChromeOS::GetMachineID(),
253 DeviceCloudPolicyManagerChromeOS::GetMachineModel(), 253 DeviceCloudPolicyManagerChromeOS::GetMachineModel(),
254 kPolicyVerificationKeyHash, device_management_service, 254 kPolicyVerificationKeyHash, device_management_service,
255 g_browser_process->system_request_context()); 255 g_browser_process->system_request_context(),
256 nullptr /* signing_service */);
256 } 257 }
257 258
258 void DeviceCloudPolicyInitializer::TryToCreateClient() { 259 void DeviceCloudPolicyInitializer::TryToCreateClient() {
259 if (!device_store_->is_initialized() || 260 if (!device_store_->is_initialized() ||
260 !device_store_->has_policy() || 261 !device_store_->has_policy() ||
261 state_keys_broker_->pending() || 262 state_keys_broker_->pending() ||
262 enrollment_handler_) { 263 enrollment_handler_) {
263 return; 264 return;
264 } 265 }
265 StartConnection(CreateClient(enterprise_service_)); 266 StartConnection(CreateClient(enterprise_service_));
266 } 267 }
267 268
268 void DeviceCloudPolicyInitializer::StartConnection( 269 void DeviceCloudPolicyInitializer::StartConnection(
269 std::unique_ptr<CloudPolicyClient> client) { 270 std::unique_ptr<CloudPolicyClient> client) {
270 if (!manager_->core()->service()) 271 if (!manager_->core()->service())
271 manager_->StartConnection(std::move(client), install_attributes_); 272 manager_->StartConnection(std::move(client), install_attributes_);
272 } 273 }
273 274
274 } // namespace policy 275 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698