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/chromeos/login/wizard_controller.h" | 8 #include "chrome/browser/chromeos/login/wizard_controller.h" |
9 #include "components/pairing/bluetooth_host_pairing_controller.h" | 9 #include "components/pairing/host_pairing_controller.h" |
10 | 10 |
11 namespace chromeos { | 11 namespace chromeos { |
12 | 12 |
13 using namespace host_pairing; | 13 using namespace host_pairing; |
14 using namespace pairing_chromeos; | 14 using namespace pairing_chromeos; |
15 | 15 |
16 HostPairingScreen::HostPairingScreen(ScreenObserver* observer, | 16 HostPairingScreen::HostPairingScreen( |
17 HostPairingScreenActor* actor) | 17 ScreenObserver* observer, |
| 18 HostPairingScreenActor* actor, |
| 19 pairing_chromeos::HostPairingController* controller) |
18 : WizardScreen(observer), | 20 : WizardScreen(observer), |
19 actor_(actor), | 21 actor_(actor), |
| 22 controller_(controller), |
20 current_stage_(HostPairingController::STAGE_NONE) { | 23 current_stage_(HostPairingController::STAGE_NONE) { |
21 actor_->SetDelegate(this); | 24 actor_->SetDelegate(this); |
22 controller_.reset(new BluetoothHostPairingController()); | |
23 controller_->AddObserver(this); | 25 controller_->AddObserver(this); |
24 } | 26 } |
25 | 27 |
26 HostPairingScreen::~HostPairingScreen() { | 28 HostPairingScreen::~HostPairingScreen() { |
27 if (actor_) | 29 if (actor_) |
28 actor_->SetDelegate(NULL); | 30 actor_->SetDelegate(NULL); |
29 controller_->RemoveObserver(this); | 31 controller_->RemoveObserver(this); |
30 } | 32 } |
31 | 33 |
32 void HostPairingScreen::CommitContextChanges() { | 34 void HostPairingScreen::CommitContextChanges() { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // TODO(zork,achuith): Enroll device, send error on error. | 125 // TODO(zork,achuith): Enroll device, send error on error. |
124 // (http://crbug.com/374990) | 126 // (http://crbug.com/374990) |
125 } | 127 } |
126 | 128 |
127 void HostPairingScreen::OnActorDestroyed(HostPairingScreenActor* actor) { | 129 void HostPairingScreen::OnActorDestroyed(HostPairingScreenActor* actor) { |
128 if (actor_ == actor) | 130 if (actor_ == actor) |
129 actor_ = NULL; | 131 actor_ = NULL; |
130 } | 132 } |
131 | 133 |
132 } // namespace chromeos | 134 } // namespace chromeos |
OLD | NEW |