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

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

Issue 12538009: Public Sessions: fetch device robot api token during enterprise enrollment. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: make api auth fetching optional; add auth failure test cases Created 7 years, 8 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
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/login/enrollment/enrollment_screen.h" 5 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 NotifyTestingObservers(success); 221 NotifyTestingObservers(success);
222 222
223 switch (status.status()) { 223 switch (status.status()) {
224 case policy::EnrollmentStatus::STATUS_SUCCESS: 224 case policy::EnrollmentStatus::STATUS_SUCCESS:
225 StartupUtils::MarkDeviceRegistered(); 225 StartupUtils::MarkDeviceRegistered();
226 UMA(is_auto_enrollment_ ? policy::kMetricEnrollmentAutoOK 226 UMA(is_auto_enrollment_ ? policy::kMetricEnrollmentAutoOK
227 : policy::kMetricEnrollmentOK); 227 : policy::kMetricEnrollmentOK);
228 return; 228 return;
229 case policy::EnrollmentStatus::STATUS_REGISTRATION_FAILED: 229 case policy::EnrollmentStatus::STATUS_REGISTRATION_FAILED:
230 case policy::EnrollmentStatus::STATUS_POLICY_FETCH_FAILED: 230 case policy::EnrollmentStatus::STATUS_POLICY_FETCH_FAILED:
231 case policy::EnrollmentStatus::STATUS_ROBOT_AUTH_FETCH_FAILED:
231 switch (status.client_status()) { 232 switch (status.client_status()) {
232 case policy::DM_STATUS_SUCCESS: 233 case policy::DM_STATUS_SUCCESS:
233 case policy::DM_STATUS_REQUEST_INVALID: 234 case policy::DM_STATUS_REQUEST_INVALID:
234 case policy::DM_STATUS_SERVICE_DEVICE_NOT_FOUND: 235 case policy::DM_STATUS_SERVICE_DEVICE_NOT_FOUND:
235 case policy::DM_STATUS_SERVICE_MANAGEMENT_TOKEN_INVALID: 236 case policy::DM_STATUS_SERVICE_MANAGEMENT_TOKEN_INVALID:
236 case policy::DM_STATUS_SERVICE_ACTIVATION_PENDING: 237 case policy::DM_STATUS_SERVICE_ACTIVATION_PENDING:
237 case policy::DM_STATUS_SERVICE_DEVICE_ID_CONFLICT: 238 case policy::DM_STATUS_SERVICE_DEVICE_ID_CONFLICT:
238 case policy::DM_STATUS_SERVICE_POLICY_NOT_FOUND: 239 case policy::DM_STATUS_SERVICE_POLICY_NOT_FOUND:
239 UMAFailure(policy::kMetricEnrollmentOtherFailed); 240 UMAFailure(policy::kMetricEnrollmentOtherFailed);
240 return; 241 return;
(...skipping 10 matching lines...) Expand all
251 UMAFailure(policy::kMetricEnrollmentInvalidSerialNumber); 252 UMAFailure(policy::kMetricEnrollmentInvalidSerialNumber);
252 return; 253 return;
253 case policy::DM_STATUS_SERVICE_MISSING_LICENSES: 254 case policy::DM_STATUS_SERVICE_MISSING_LICENSES:
254 UMAFailure(policy::kMetricMissingLicensesError); 255 UMAFailure(policy::kMetricMissingLicensesError);
255 return; 256 return;
256 } 257 }
257 break; 258 break;
258 case policy::EnrollmentStatus::STATUS_REGISTRATION_BAD_MODE: 259 case policy::EnrollmentStatus::STATUS_REGISTRATION_BAD_MODE:
259 UMAFailure(policy::kMetricEnrollmentInvalidEnrollmentMode); 260 UMAFailure(policy::kMetricEnrollmentInvalidEnrollmentMode);
260 return; 261 return;
262 case policy::EnrollmentStatus::STATUS_ROBOT_REFRESH_FETCH_FAILED:
263 UMAFailure(policy::kMetricEnrollmentRobotRefreshTokenFetchFailed);
264 return;
261 case policy::EnrollmentStatus::STATUS_LOCK_TIMEOUT: 265 case policy::EnrollmentStatus::STATUS_LOCK_TIMEOUT:
262 UMAFailure(policy::kMetricLockboxTimeoutError); 266 UMAFailure(policy::kMetricLockboxTimeoutError);
263 return; 267 return;
264 case policy::EnrollmentStatus::STATUS_LOCK_WRONG_USER: 268 case policy::EnrollmentStatus::STATUS_LOCK_WRONG_USER:
265 UMAFailure(policy::kMetricEnrollmentWrongUserError); 269 UMAFailure(policy::kMetricEnrollmentWrongUserError);
266 return; 270 return;
267 case policy::EnrollmentStatus::STATUS_VALIDATION_FAILED: 271 case policy::EnrollmentStatus::STATUS_VALIDATION_FAILED:
268 case policy::EnrollmentStatus::STATUS_STORE_ERROR: 272 case policy::EnrollmentStatus::STATUS_STORE_ERROR:
269 case policy::EnrollmentStatus::STATUS_LOCK_ERROR: 273 case policy::EnrollmentStatus::STATUS_LOCK_ERROR:
270 UMAFailure(policy::kMetricEnrollmentOtherFailed); 274 UMAFailure(policy::kMetricEnrollmentOtherFailed);
(...skipping 14 matching lines...) Expand all
285 actor_->Show(); 289 actor_->Show();
286 actor_->ShowSigninScreen(); 290 actor_->ShowSigninScreen();
287 } 291 }
288 292
289 void EnrollmentScreen::NotifyTestingObservers(bool succeeded) { 293 void EnrollmentScreen::NotifyTestingObservers(bool succeeded) {
290 FOR_EACH_OBSERVER(TestingObserver, observers_, 294 FOR_EACH_OBSERVER(TestingObserver, observers_,
291 OnEnrollmentComplete(succeeded)); 295 OnEnrollmentComplete(succeeded));
292 } 296 }
293 297
294 } // namespace chromeos 298 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698