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

Side by Side Diff: chrome/browser/chromeos/policy/enrollment_handler_chromeos.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 (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/enrollment_handler_chromeos.h" 5 #include "chrome/browser/chromeos/policy/enrollment_handler_chromeos.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 new em::PolicyFetchResponse(*policy)), 165 new em::PolicyFetchResponse(*policy)),
166 background_task_runner_)); 166 background_task_runner_));
167 167
168 validator->ValidateTimestamp( 168 validator->ValidateTimestamp(
169 base::Time(), base::Time::NowFromSystemTime(), 169 base::Time(), base::Time::NowFromSystemTime(),
170 CloudPolicyValidatorBase::TIMESTAMP_FULLY_VALIDATED); 170 CloudPolicyValidatorBase::TIMESTAMP_FULLY_VALIDATED);
171 171
172 // If this is re-enrollment, make sure that the new policy matches the 172 // If this is re-enrollment, make sure that the new policy matches the
173 // previously-enrolled domain. 173 // previously-enrolled domain.
174 std::string domain; 174 std::string domain;
175 if (install_attributes_->IsEnterpriseDevice()) { 175 if (install_attributes_->IsEnterpriseManaged()) {
176 domain = install_attributes_->GetDomain(); 176 domain = install_attributes_->GetDomain();
177 validator->ValidateDomain(domain); 177 validator->ValidateDomain(domain);
178 } 178 }
179 validator->ValidateDMToken(client->dm_token(), 179 validator->ValidateDMToken(client->dm_token(),
180 CloudPolicyValidatorBase::DM_TOKEN_REQUIRED); 180 CloudPolicyValidatorBase::DM_TOKEN_REQUIRED);
181 validator->ValidatePolicyType(dm_protocol::kChromeDevicePolicyType); 181 validator->ValidatePolicyType(dm_protocol::kChromeDevicePolicyType);
182 validator->ValidatePayload(); 182 validator->ValidatePayload();
183 // If |domain| is empty here, the policy validation code will just use the 183 // If |domain| is empty here, the policy validation code will just use the
184 // domain from the username field in the policy itself to do key validation. 184 // domain from the username field in the policy itself to do key validation.
185 // TODO(mnissler): Plumb the enrolling user's username into this object so we 185 // TODO(mnissler): Plumb the enrolling user's username into this object so we
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 callback.Run(status); 524 callback.Run(status);
525 } 525 }
526 526
527 void EnrollmentHandlerChromeOS::SetStep(EnrollmentStep step) { 527 void EnrollmentHandlerChromeOS::SetStep(EnrollmentStep step) {
528 DCHECK_LE(enrollment_step_, step); 528 DCHECK_LE(enrollment_step_, step);
529 VLOG(1) << "Step: " << step; 529 VLOG(1) << "Step: " << step;
530 enrollment_step_ = step; 530 enrollment_step_ = step;
531 } 531 }
532 532
533 } // namespace policy 533 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698