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

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

Issue 2433363004: Chromad: added AD Join ui, authpolicy_client (Closed)
Patch Set: nit Created 4 years, 1 month 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 void DeviceCloudPolicyInitializer::StartEnrollment( 95 void DeviceCloudPolicyInitializer::StartEnrollment(
96 DeviceManagementService* device_management_service, 96 DeviceManagementService* device_management_service,
97 const EnrollmentConfig& enrollment_config, 97 const EnrollmentConfig& enrollment_config,
98 const std::string& auth_token, 98 const std::string& auth_token,
99 const EnrollmentCallback& enrollment_callback) { 99 const EnrollmentCallback& enrollment_callback) {
100 DCHECK(is_initialized_); 100 DCHECK(is_initialized_);
101 DCHECK(!enrollment_handler_); 101 DCHECK(!enrollment_handler_);
102 102
103 manager_->core()->Disconnect(); 103 manager_->core()->Disconnect();
104 // TODO(rsorokin): make proper SetDeviceRequisition
105 if (!enrollment_config.management_realm.empty())
106 manager_->SetDeviceRequisition("chrome_ad");
107
104 enrollment_handler_.reset(new EnrollmentHandlerChromeOS( 108 enrollment_handler_.reset(new EnrollmentHandlerChromeOS(
105 device_store_, install_attributes_, state_keys_broker_, 109 device_store_, install_attributes_, state_keys_broker_,
106 attestation_flow_.get(), CreateClient(device_management_service), 110 attestation_flow_.get(), CreateClient(device_management_service),
107 background_task_runner_, enrollment_config, auth_token, 111 background_task_runner_, enrollment_config, auth_token,
108 install_attributes_->GetDeviceId(), manager_->GetDeviceRequisition(), 112 install_attributes_->GetDeviceId(), manager_->GetDeviceRequisition(),
109 base::Bind(&DeviceCloudPolicyInitializer::EnrollmentCompleted, 113 base::Bind(&DeviceCloudPolicyInitializer::EnrollmentCompleted,
110 base::Unretained(this), enrollment_callback))); 114 base::Unretained(this), enrollment_callback)));
111 enrollment_handler_->StartEnrollment(); 115 enrollment_handler_->StartEnrollment();
112 } 116 }
113 117
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 if (success && (success = att_signed_data.ParseFromString(signed_data))) { 327 if (success && (success = att_signed_data.ParseFromString(signed_data))) {
324 em_signed_data.set_data(att_signed_data.data()); 328 em_signed_data.set_data(att_signed_data.data());
325 em_signed_data.set_signature(att_signed_data.signature()); 329 em_signed_data.set_signature(att_signed_data.signature());
326 em_signed_data.set_extra_data_bytes(att_signed_data.data().size() - 330 em_signed_data.set_extra_data_bytes(att_signed_data.data().size() -
327 data.size()); 331 data.size());
328 } 332 }
329 callback.Run(success, em_signed_data); 333 callback.Run(success, em_signed_data);
330 } 334 }
331 335
332 } // namespace policy 336 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698