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

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

Issue 2486813002: Add DeviceADPolicyManager to provide AD policy. (Closed)
Patch Set: Address Bernhard's comments 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 break; 141 break;
142 } 142 }
143 143
144 // If OOBE is done and we are not enrolled, make sure we only try interactive 144 // If OOBE is done and we are not enrolled, make sure we only try interactive
145 // enrollment. 145 // enrollment.
146 const bool oobe_complete = local_state_->GetBoolean(prefs::kOobeComplete); 146 const bool oobe_complete = local_state_->GetBoolean(prefs::kOobeComplete);
147 if (oobe_complete && 147 if (oobe_complete &&
148 config.auth_mechanism == EnrollmentConfig::AUTH_MECHANISM_BEST_AVAILABLE) 148 config.auth_mechanism == EnrollmentConfig::AUTH_MECHANISM_BEST_AVAILABLE)
149 config.auth_mechanism = EnrollmentConfig::AUTH_MECHANISM_INTERACTIVE; 149 config.auth_mechanism = EnrollmentConfig::AUTH_MECHANISM_INTERACTIVE;
150 // If OOBE is done and we are enrolled, check for need to recover enrollment. 150 // If OOBE is done and we are enrolled, check for need to recover enrollment.
151 if (oobe_complete && install_attributes_->IsEnterpriseDevice()) { 151 if (oobe_complete && install_attributes_->IsEnterpriseManaged()) {
152 // Regardless what mode is applicable, the enrollment domain is fixed. 152 // Regardless what mode is applicable, the enrollment domain is fixed.
153 config.management_domain = install_attributes_->GetDomain(); 153 config.management_domain = install_attributes_->GetDomain();
154 154
155 // Enrollment has completed previously and installation-time attributes 155 // Enrollment has completed previously and installation-time attributes
156 // are in place. Enrollment recovery is required when the server 156 // are in place. Enrollment recovery is required when the server
157 // registration gets lost. 157 // registration gets lost.
158 if (local_state_->GetBoolean(prefs::kEnrollmentRecoveryRequired)) { 158 if (local_state_->GetBoolean(prefs::kEnrollmentRecoveryRequired)) {
159 LOG(WARNING) << "Enrollment recovery required according to pref."; 159 LOG(WARNING) << "Enrollment recovery required according to pref.";
160 if (statistics_provider_->GetEnterpriseMachineID().empty()) 160 if (statistics_provider_->GetEnterpriseMachineID().empty())
161 LOG(WARNING) << "Postponing recovery because machine id is missing."; 161 LOG(WARNING) << "Postponing recovery because machine id is missing.";
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 if (success && (success = att_signed_data.ParseFromString(signed_data))) { 324 if (success && (success = att_signed_data.ParseFromString(signed_data))) {
325 em_signed_data.set_data(att_signed_data.data()); 325 em_signed_data.set_data(att_signed_data.data());
326 em_signed_data.set_signature(att_signed_data.signature()); 326 em_signed_data.set_signature(att_signed_data.signature());
327 em_signed_data.set_extra_data_bytes(att_signed_data.data().size() - 327 em_signed_data.set_extra_data_bytes(att_signed_data.data().size() -
328 data.size()); 328 data.size());
329 } 329 }
330 callback.Run(success, em_signed_data); 330 callback.Run(success, em_signed_data);
331 } 331 }
332 332
333 } // namespace policy 333 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698