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

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

Issue 2534433002: Mop up incorrect uses of IsEnterpriseManaged() (Closed)
Patch Set: Address Roman's comment Created 4 years 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 DeviceCloudPolicyValidator::Create( 163 DeviceCloudPolicyValidator::Create(
164 std::unique_ptr<em::PolicyFetchResponse>( 164 std::unique_ptr<em::PolicyFetchResponse>(
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. (Currently only implemented for cloud
174 // management.)
174 std::string domain; 175 std::string domain;
175 if (install_attributes_->IsEnterpriseManaged()) { 176 if (install_attributes_->IsCloudManaged()) {
176 domain = install_attributes_->GetDomain(); 177 domain = install_attributes_->GetDomain();
177 validator->ValidateDomain(domain); 178 validator->ValidateDomain(domain);
178 } 179 }
179 validator->ValidateDMToken(client->dm_token(), 180 validator->ValidateDMToken(client->dm_token(),
180 CloudPolicyValidatorBase::DM_TOKEN_REQUIRED); 181 CloudPolicyValidatorBase::DM_TOKEN_REQUIRED);
181 validator->ValidatePolicyType(dm_protocol::kChromeDevicePolicyType); 182 validator->ValidatePolicyType(dm_protocol::kChromeDevicePolicyType);
182 validator->ValidatePayload(); 183 validator->ValidatePayload();
183 // If |domain| is empty here, the policy validation code will just use the 184 // 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. 185 // 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 186 // 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); 525 callback.Run(status);
525 } 526 }
526 527
527 void EnrollmentHandlerChromeOS::SetStep(EnrollmentStep step) { 528 void EnrollmentHandlerChromeOS::SetStep(EnrollmentStep step) {
528 DCHECK_LE(enrollment_step_, step); 529 DCHECK_LE(enrollment_step_, step);
529 VLOG(1) << "Step: " << step; 530 VLOG(1) << "Step: " << step;
530 enrollment_step_ = step; 531 enrollment_step_ = step;
531 } 532 }
532 533
533 } // namespace policy 534 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698