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 "components/pairing/bluetooth_controller_pairing_controller.h" | |
11 #include "google_apis/gaia/gaia_auth_util.h" | 10 #include "google_apis/gaia/gaia_auth_util.h" |
12 | 11 |
13 using namespace chromeos::controller_pairing; | 12 using namespace chromeos::controller_pairing; |
14 using namespace pairing_chromeos; | 13 using namespace pairing_chromeos; |
15 | 14 |
16 namespace { | 15 namespace { |
17 const char* kTestAuthToken = "TestAuthToken"; | 16 const char* kTestAuthToken = "TestAuthToken"; |
18 }; | 17 }; |
19 | 18 |
20 namespace chromeos { | 19 namespace chromeos { |
21 | 20 |
22 ControllerPairingScreen::ControllerPairingScreen( | 21 ControllerPairingScreen::ControllerPairingScreen( |
23 ScreenObserver* observer, | 22 ScreenObserver* observer, |
24 ControllerPairingScreenActor* actor) | 23 ControllerPairingScreenActor* actor, |
| 24 ControllerPairingController* controller) |
25 : WizardScreen(observer), | 25 : WizardScreen(observer), |
26 actor_(actor), | 26 actor_(actor), |
| 27 controller_(controller), |
27 current_stage_(ControllerPairingController::STAGE_NONE), | 28 current_stage_(ControllerPairingController::STAGE_NONE), |
28 device_preselected_(false) { | 29 device_preselected_(false) { |
29 actor_->SetDelegate(this); | 30 actor_->SetDelegate(this); |
30 controller_.reset(new BluetoothControllerPairingController()); | |
31 controller_->AddObserver(this); | 31 controller_->AddObserver(this); |
32 } | 32 } |
33 | 33 |
34 ControllerPairingScreen::~ControllerPairingScreen() { | 34 ControllerPairingScreen::~ControllerPairingScreen() { |
35 if (actor_) | 35 if (actor_) |
36 actor_->SetDelegate(NULL); | 36 actor_->SetDelegate(NULL); |
37 controller_->RemoveObserver(this); | 37 controller_->RemoveObserver(this); |
38 } | 38 } |
39 | 39 |
40 void ControllerPairingScreen::CommitContextChanges() { | 40 void ControllerPairingScreen::CommitContextChanges() { |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 ++key) { | 218 ++key) { |
219 if (*key == kContextKeySelectedDevice) { | 219 if (*key == kContextKeySelectedDevice) { |
220 context_.SetBoolean(kContextKeyControlsDisabled, | 220 context_.SetBoolean(kContextKeyControlsDisabled, |
221 context_.GetString(*key).empty()); | 221 context_.GetString(*key).empty()); |
222 CommitContextChanges(); | 222 CommitContextChanges(); |
223 } | 223 } |
224 } | 224 } |
225 } | 225 } |
226 | 226 |
227 } // namespace chromeos | 227 } // namespace chromeos |
OLD | NEW |