| 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" |
| 11 | 11 |
| 12 using namespace chromeos::controller_pairing; | 12 using namespace chromeos::controller_pairing; |
| 13 using namespace pairing_chromeos; | 13 using namespace pairing_chromeos; |
| 14 | 14 |
| 15 namespace chromeos { | 15 namespace chromeos { |
| 16 | 16 |
| 17 ControllerPairingScreen::ControllerPairingScreen( | 17 ControllerPairingScreen::ControllerPairingScreen( |
| 18 ScreenObserver* observer, | 18 BaseScreenDelegate* base_screen_delegate, |
| 19 ControllerPairingScreenActor* actor, | 19 ControllerPairingScreenActor* actor, |
| 20 ControllerPairingController* shark_controller) | 20 ControllerPairingController* shark_controller) |
| 21 : BaseScreen(observer), | 21 : BaseScreen(base_screen_delegate), |
| 22 actor_(actor), | 22 actor_(actor), |
| 23 shark_controller_(shark_controller), | 23 shark_controller_(shark_controller), |
| 24 delegate_(nullptr), | 24 delegate_(nullptr), |
| 25 current_stage_(ControllerPairingController::STAGE_NONE), | 25 current_stage_(ControllerPairingController::STAGE_NONE), |
| 26 device_preselected_(false) { | 26 device_preselected_(false) { |
| 27 actor_->SetDelegate(this); | 27 actor_->SetDelegate(this); |
| 28 shark_controller_->AddObserver(this); | 28 shark_controller_->AddObserver(this); |
| 29 } | 29 } |
| 30 | 30 |
| 31 ControllerPairingScreen::~ControllerPairingScreen() { | 31 ControllerPairingScreen::~ControllerPairingScreen() { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 case ControllerPairingController::STAGE_HOST_UPDATE_IN_PROGRESS: { | 111 case ControllerPairingController::STAGE_HOST_UPDATE_IN_PROGRESS: { |
| 112 desired_page = kPageHostUpdate; | 112 desired_page = kPageHostUpdate; |
| 113 break; | 113 break; |
| 114 } | 114 } |
| 115 case ControllerPairingController::STAGE_HOST_CONNECTION_LOST: { | 115 case ControllerPairingController::STAGE_HOST_CONNECTION_LOST: { |
| 116 desired_page = kPageHostConnectionLost; | 116 desired_page = kPageHostConnectionLost; |
| 117 break; | 117 break; |
| 118 } | 118 } |
| 119 case ControllerPairingController::STAGE_WAITING_FOR_CREDENTIALS: { | 119 case ControllerPairingController::STAGE_WAITING_FOR_CREDENTIALS: { |
| 120 shark_controller_->RemoveObserver(this); | 120 shark_controller_->RemoveObserver(this); |
| 121 get_screen_observer()->OnExit( | 121 get_base_screen_delegate()->OnExit( |
| 122 WizardController::CONTROLLER_PAIRING_FINISHED); | 122 WizardController::CONTROLLER_PAIRING_FINISHED); |
| 123 desired_page = kPageEnrollmentIntroduction; | 123 desired_page = kPageEnrollmentIntroduction; |
| 124 break; | 124 break; |
| 125 } | 125 } |
| 126 case ControllerPairingController::STAGE_INITIALIZATION_ERROR: { | 126 case ControllerPairingController::STAGE_INITIALIZATION_ERROR: { |
| 127 // TODO(achuith, dzhioev, zork): Handle this better. | 127 // TODO(achuith, dzhioev, zork): Handle this better. |
| 128 LOG(WARNING) << "Bluetooth initialization error"; | 128 LOG(WARNING) << "Bluetooth initialization error"; |
| 129 break; | 129 break; |
| 130 } | 130 } |
| 131 default: | 131 default: |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 ++key) { | 214 ++key) { |
| 215 if (*key == kContextKeySelectedDevice) { | 215 if (*key == kContextKeySelectedDevice) { |
| 216 context_.SetBoolean(kContextKeyControlsDisabled, | 216 context_.SetBoolean(kContextKeyControlsDisabled, |
| 217 context_.GetString(*key).empty()); | 217 context_.GetString(*key).empty()); |
| 218 CommitContextChanges(); | 218 CommitContextChanges(); |
| 219 } | 219 } |
| 220 } | 220 } |
| 221 } | 221 } |
| 222 | 222 |
| 223 } // namespace chromeos | 223 } // namespace chromeos |
| OLD | NEW |