| 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/controller_pairing_screen.h" | 5 #include "chrome/browser/chromeos/login/screens/controller_pairing_screen.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/chromeos/login/wizard_controller.h" | 9 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 10 #include "google_apis/gaia/gaia_auth_util.h" | 10 #include "google_apis/gaia/gaia_auth_util.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 break; | 103 break; |
| 104 } | 104 } |
| 105 case ControllerPairingController::STAGE_HOST_CONNECTION_LOST: { | 105 case ControllerPairingController::STAGE_HOST_CONNECTION_LOST: { |
| 106 desired_page = kPageHostConnectionLost; | 106 desired_page = kPageHostConnectionLost; |
| 107 break; | 107 break; |
| 108 } | 108 } |
| 109 case ControllerPairingController::STAGE_WAITING_FOR_CREDENTIALS: { | 109 case ControllerPairingController::STAGE_WAITING_FOR_CREDENTIALS: { |
| 110 controller_->RemoveObserver(this); | 110 controller_->RemoveObserver(this); |
| 111 get_screen_observer()->OnExit( | 111 get_screen_observer()->OnExit( |
| 112 WizardController::CONTROLLER_PAIRING_FINISHED); | 112 WizardController::CONTROLLER_PAIRING_FINISHED); |
| 113 // TODO(achuith, zork): Move the rest of the stages to the proper | |
| 114 // location. | |
| 115 desired_page = kPageEnrollmentIntroduction; | 113 desired_page = kPageEnrollmentIntroduction; |
| 116 break; | 114 break; |
| 117 } | 115 } |
| 118 case ControllerPairingController::STAGE_HOST_ENROLLMENT_IN_PROGRESS: { | |
| 119 desired_page = kPageHostEnrollment; | |
| 120 break; | |
| 121 } | |
| 122 case ControllerPairingController::STAGE_HOST_ENROLLMENT_ERROR: { | |
| 123 desired_page = kPageHostEnrollmentError; | |
| 124 break; | |
| 125 } | |
| 126 case ControllerPairingController::STAGE_PAIRING_DONE: { | |
| 127 desired_page = kPagePairingDone; | |
| 128 break; | |
| 129 } | |
| 130 case ControllerPairingController::STAGE_FINISHED: { | |
| 131 get_screen_observer()->OnExit( | |
| 132 WizardController::CONTROLLER_PAIRING_FINISHED); | |
| 133 break; | |
| 134 } | |
| 135 default: | 116 default: |
| 136 NOTREACHED(); | 117 NOTREACHED(); |
| 137 } | 118 } |
| 138 current_stage_ = new_stage; | 119 current_stage_ = new_stage; |
| 139 context_.SetString(kContextKeyPage, desired_page); | 120 context_.SetString(kContextKeyPage, desired_page); |
| 140 context_.SetBoolean(kContextKeyControlsDisabled, false); | 121 context_.SetBoolean(kContextKeyControlsDisabled, false); |
| 141 CommitContextChanges(); | 122 CommitContextChanges(); |
| 142 VLOG(1) << "PairingStageChanged " << desired_page | 123 VLOG(1) << "PairingStageChanged " << desired_page |
| 143 << ", current stage " << current_stage_; | 124 << ", current stage " << current_stage_; |
| 144 } | 125 } |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 ++key) { | 199 ++key) { |
| 219 if (*key == kContextKeySelectedDevice) { | 200 if (*key == kContextKeySelectedDevice) { |
| 220 context_.SetBoolean(kContextKeyControlsDisabled, | 201 context_.SetBoolean(kContextKeyControlsDisabled, |
| 221 context_.GetString(*key).empty()); | 202 context_.GetString(*key).empty()); |
| 222 CommitContextChanges(); | 203 CommitContextChanges(); |
| 223 } | 204 } |
| 224 } | 205 } |
| 225 } | 206 } |
| 226 | 207 |
| 227 } // namespace chromeos | 208 } // namespace chromeos |
| OLD | NEW |