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

Side by Side Diff: chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_impl.cc

Issue 2329303002: Delete obsolete AllowedDeviceModes enrollment parameter. (Closed)
Patch Set: Fix tests. 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/device_cloud_policy_initializer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/login/enrollment/enterprise_enrollment_helper_ impl.h" 5 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_ impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 connector->GetEnterpriseDomain() != enrolling_user_domain_) { 150 connector->GetEnterpriseDomain() != enrolling_user_domain_) {
151 LOG(ERROR) << "Trying to re-enroll to a different domain than " 151 LOG(ERROR) << "Trying to re-enroll to a different domain than "
152 << connector->GetEnterpriseDomain(); 152 << connector->GetEnterpriseDomain();
153 UMA(policy::kMetricEnrollmentPrecheckDomainMismatch); 153 UMA(policy::kMetricEnrollmentPrecheckDomainMismatch);
154 if (oauth_status_ != OAUTH_NOT_STARTED) 154 if (oauth_status_ != OAUTH_NOT_STARTED)
155 oauth_status_ = OAUTH_FINISHED; 155 oauth_status_ = OAUTH_FINISHED;
156 status_consumer()->OnOtherError(OTHER_ERROR_DOMAIN_MISMATCH); 156 status_consumer()->OnOtherError(OTHER_ERROR_DOMAIN_MISMATCH);
157 return; 157 return;
158 } 158 }
159 159
160 policy::DeviceCloudPolicyInitializer::AllowedDeviceModes device_modes;
161 device_modes[policy::DEVICE_MODE_ENTERPRISE] = true;
162 connector->ScheduleServiceInitialization(0); 160 connector->ScheduleServiceInitialization(0);
163
164 policy::DeviceCloudPolicyInitializer* dcp_initializer = 161 policy::DeviceCloudPolicyInitializer* dcp_initializer =
165 connector->GetDeviceCloudPolicyInitializer(); 162 connector->GetDeviceCloudPolicyInitializer();
166 CHECK(dcp_initializer); 163 CHECK(dcp_initializer);
achuithb 2016/09/12 18:15:40 Curious: why do we have this CHECK? The next line
Thiemo Nagel 2016/09/12 18:23:56 Dereferencing a nullptr is undefined behavior. If
167 dcp_initializer->StartEnrollment( 164 dcp_initializer->StartEnrollment(
168 connector->device_management_service(), enrollment_config_, token, 165 connector->device_management_service(), enrollment_config_, token,
169 device_modes,
170 base::Bind(&EnterpriseEnrollmentHelperImpl::OnEnrollmentFinished, 166 base::Bind(&EnterpriseEnrollmentHelperImpl::OnEnrollmentFinished,
171 weak_ptr_factory_.GetWeakPtr())); 167 weak_ptr_factory_.GetWeakPtr()));
172 } 168 }
173 169
174 void EnterpriseEnrollmentHelperImpl::GetDeviceAttributeUpdatePermission() { 170 void EnterpriseEnrollmentHelperImpl::GetDeviceAttributeUpdatePermission() {
175 // TODO(pbond): remove this LOG once http://crbug.com/586961 is fixed. 171 // TODO(pbond): remove this LOG once http://crbug.com/586961 is fixed.
176 LOG(WARNING) << "Get device attribute update permission"; 172 LOG(WARNING) << "Get device attribute update permission";
177 policy::BrowserPolicyConnectorChromeOS* connector = 173 policy::BrowserPolicyConnectorChromeOS* connector =
178 g_browser_process->platform_part()->browser_policy_connector_chromeos(); 174 g_browser_process->platform_part()->browser_policy_connector_chromeos();
179 policy::DeviceCloudPolicyManagerChromeOS* policy_manager = 175 policy::DeviceCloudPolicyManagerChromeOS* policy_manager =
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 EnrollmentUMA(sample, enrollment_config_.mode); 424 EnrollmentUMA(sample, enrollment_config_.mode);
429 } 425 }
430 426
431 void EnterpriseEnrollmentHelperImpl::OnSigninProfileCleared( 427 void EnterpriseEnrollmentHelperImpl::OnSigninProfileCleared(
432 const base::Closure& callback) { 428 const base::Closure& callback) {
433 oauth_data_cleared_ = true; 429 oauth_data_cleared_ = true;
434 callback.Run(); 430 callback.Run();
435 } 431 }
436 432
437 } // namespace chromeos 433 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/device_cloud_policy_initializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698