| OLD | NEW |
| 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/screens/host_pairing_screen.h" | 5 #include "chrome/browser/chromeos/login/screens/host_pairing_screen.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/chromeos/login/startup_utils.h" | 9 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 10 #include "chrome/browser/chromeos/login/wizard_controller.h" | 10 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 actor_->Hide(); | 61 actor_->Hide(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 std::string HostPairingScreen::GetName() const { | 64 std::string HostPairingScreen::GetName() const { |
| 65 return WizardController::kHostPairingScreenName; | 65 return WizardController::kHostPairingScreenName; |
| 66 } | 66 } |
| 67 | 67 |
| 68 void HostPairingScreen::PairingStageChanged(Stage new_stage) { | 68 void HostPairingScreen::PairingStageChanged(Stage new_stage) { |
| 69 std::string desired_page; | 69 std::string desired_page; |
| 70 switch (new_stage) { | 70 switch (new_stage) { |
| 71 case HostPairingController::STAGE_INITIALIZATION_ERROR: { |
| 72 desired_page = kPageIntializationError; |
| 73 break; |
| 74 } |
| 71 case HostPairingController::STAGE_WAITING_FOR_CONTROLLER: | 75 case HostPairingController::STAGE_WAITING_FOR_CONTROLLER: |
| 72 case HostPairingController::STAGE_WAITING_FOR_CONTROLLER_AFTER_UPDATE: { | 76 case HostPairingController::STAGE_WAITING_FOR_CONTROLLER_AFTER_UPDATE: { |
| 73 desired_page = kPageWelcome; | 77 desired_page = kPageWelcome; |
| 74 break; | 78 break; |
| 75 } | 79 } |
| 76 case HostPairingController::STAGE_WAITING_FOR_CODE_CONFIRMATION: { | 80 case HostPairingController::STAGE_WAITING_FOR_CODE_CONFIRMATION: { |
| 77 desired_page = kPageCodeConfirmation; | 81 desired_page = kPageCodeConfirmation; |
| 78 context_.SetString(kContextKeyConfirmationCode, | 82 context_.SetString(kContextKeyConfirmationCode, |
| 79 remora_controller_->GetConfirmationCode()); | 83 remora_controller_->GetConfirmationCode()); |
| 80 break; | 84 break; |
| 81 } | 85 } |
| 86 case HostPairingController::STAGE_CONTROLLER_CONNECTION_ERROR: { |
| 87 desired_page = kPageConnectionError; |
| 88 break; |
| 89 } |
| 82 case HostPairingController::STAGE_SETUP_BASIC_CONFIGURATION: { | 90 case HostPairingController::STAGE_SETUP_BASIC_CONFIGURATION: { |
| 83 desired_page = kPageSetupBasicConfiguration; | 91 desired_page = kPageSetupBasicConfiguration; |
| 84 break; | 92 break; |
| 85 } | 93 } |
| 86 case HostPairingController::STAGE_SETUP_NETWORK_ERROR: { | 94 case HostPairingController::STAGE_SETUP_NETWORK_ERROR: { |
| 87 desired_page = kPageSetupNetworkError; | 95 desired_page = kPageSetupNetworkError; |
| 88 break; | 96 break; |
| 89 } | 97 } |
| 90 case HostPairingController::STAGE_WAITING_FOR_CREDENTIALS: { | 98 case HostPairingController::STAGE_WAITING_FOR_CREDENTIALS: { |
| 91 desired_page = kPageEnrollmentIntroduction; | 99 desired_page = kPageEnrollmentIntroduction; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 } | 201 } |
| 194 | 202 |
| 195 void HostPairingScreen::OnAnyEnrollmentError() { | 203 void HostPairingScreen::OnAnyEnrollmentError() { |
| 196 enrollment_helper_->ClearAuth(base::Bind(&HostPairingScreen::OnAuthCleared, | 204 enrollment_helper_->ClearAuth(base::Bind(&HostPairingScreen::OnAuthCleared, |
| 197 weak_ptr_factory_.GetWeakPtr())); | 205 weak_ptr_factory_.GetWeakPtr())); |
| 198 remora_controller_->OnEnrollmentStatusChanged( | 206 remora_controller_->OnEnrollmentStatusChanged( |
| 199 HostPairingController::ENROLLMENT_STATUS_FAILURE); | 207 HostPairingController::ENROLLMENT_STATUS_FAILURE); |
| 200 } | 208 } |
| 201 | 209 |
| 202 } // namespace chromeos | 210 } // namespace chromeos |
| OLD | NEW |