| OLD | NEW |
| 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/ui/webui/chromeos/login/enrollment_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 void EnrollmentScreenHandler::ShowEnrollmentSpinnerScreen() { | 177 void EnrollmentScreenHandler::ShowEnrollmentSpinnerScreen() { |
| 178 ShowStep(kEnrollmentStepWorking); | 178 ShowStep(kEnrollmentStepWorking); |
| 179 } | 179 } |
| 180 | 180 |
| 181 void EnrollmentScreenHandler::ShowAuthError( | 181 void EnrollmentScreenHandler::ShowAuthError( |
| 182 const GoogleServiceAuthError& error) { | 182 const GoogleServiceAuthError& error) { |
| 183 switch (error.state()) { | 183 switch (error.state()) { |
| 184 case GoogleServiceAuthError::NONE: | 184 case GoogleServiceAuthError::NONE: |
| 185 case GoogleServiceAuthError::CAPTCHA_REQUIRED: | 185 case GoogleServiceAuthError::CAPTCHA_REQUIRED: |
| 186 case GoogleServiceAuthError::TWO_FACTOR: | 186 case GoogleServiceAuthError::TWO_FACTOR: |
| 187 case GoogleServiceAuthError::HOSTED_NOT_ALLOWED: | |
| 188 case GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS: | 187 case GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS: |
| 189 case GoogleServiceAuthError::REQUEST_CANCELED: | 188 case GoogleServiceAuthError::REQUEST_CANCELED: |
| 190 case GoogleServiceAuthError::UNEXPECTED_SERVICE_RESPONSE: | 189 case GoogleServiceAuthError::UNEXPECTED_SERVICE_RESPONSE: |
| 191 case GoogleServiceAuthError::SERVICE_ERROR: | 190 case GoogleServiceAuthError::SERVICE_ERROR: |
| 192 case GoogleServiceAuthError::WEB_LOGIN_REQUIRED: | 191 case GoogleServiceAuthError::WEB_LOGIN_REQUIRED: |
| 193 ShowError(IDS_ENTERPRISE_ENROLLMENT_AUTH_FATAL_ERROR, false); | 192 ShowError(IDS_ENTERPRISE_ENROLLMENT_AUTH_FATAL_ERROR, false); |
| 194 return; | 193 return; |
| 195 case GoogleServiceAuthError::USER_NOT_SIGNED_UP: | 194 case GoogleServiceAuthError::USER_NOT_SIGNED_UP: |
| 196 case GoogleServiceAuthError::ACCOUNT_DELETED: | 195 case GoogleServiceAuthError::ACCOUNT_DELETED: |
| 197 case GoogleServiceAuthError::ACCOUNT_DISABLED: | 196 case GoogleServiceAuthError::ACCOUNT_DISABLED: |
| 198 ShowError(IDS_ENTERPRISE_ENROLLMENT_AUTH_ACCOUNT_ERROR, true); | 197 ShowError(IDS_ENTERPRISE_ENROLLMENT_AUTH_ACCOUNT_ERROR, true); |
| 199 return; | 198 return; |
| 200 case GoogleServiceAuthError::CONNECTION_FAILED: | 199 case GoogleServiceAuthError::CONNECTION_FAILED: |
| 201 case GoogleServiceAuthError::SERVICE_UNAVAILABLE: | 200 case GoogleServiceAuthError::SERVICE_UNAVAILABLE: |
| 202 ShowError(IDS_ENTERPRISE_ENROLLMENT_AUTH_NETWORK_ERROR, true); | 201 ShowError(IDS_ENTERPRISE_ENROLLMENT_AUTH_NETWORK_ERROR, true); |
| 203 return; | 202 return; |
| 203 case GoogleServiceAuthError::HOSTED_NOT_ALLOWED_DEPRECATED: |
| 204 case GoogleServiceAuthError::NUM_STATES: | 204 case GoogleServiceAuthError::NUM_STATES: |
| 205 break; | 205 break; |
| 206 } | 206 } |
| 207 NOTREACHED(); | 207 NOTREACHED(); |
| 208 } | 208 } |
| 209 | 209 |
| 210 void EnrollmentScreenHandler::ShowOtherError( | 210 void EnrollmentScreenHandler::ShowOtherError( |
| 211 EnterpriseEnrollmentHelper::OtherError error) { | 211 EnterpriseEnrollmentHelper::OtherError error) { |
| 212 switch (error) { | 212 switch (error) { |
| 213 case EnterpriseEnrollmentHelper::OTHER_ERROR_DOMAIN_MISMATCH: | 213 case EnterpriseEnrollmentHelper::OTHER_ERROR_DOMAIN_MISMATCH: |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 | 542 |
| 543 ShowScreenWithData(OobeScreen::SCREEN_OOBE_ENROLLMENT, &screen_data); | 543 ShowScreenWithData(OobeScreen::SCREEN_OOBE_ENROLLMENT, &screen_data); |
| 544 if (first_show_) { | 544 if (first_show_) { |
| 545 first_show_ = false; | 545 first_show_ = false; |
| 546 UpdateStateInternal(NetworkError::ERROR_REASON_UPDATE, true); | 546 UpdateStateInternal(NetworkError::ERROR_REASON_UPDATE, true); |
| 547 } | 547 } |
| 548 histogram_helper_->OnScreenShow(); | 548 histogram_helper_->OnScreenShow(); |
| 549 } | 549 } |
| 550 | 550 |
| 551 } // namespace chromeos | 551 } // namespace chromeos |
| OLD | NEW |