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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CONTROLLER_PAIRING_SCREEN_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CONTROLLER_PAIRING_SCREEN_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CONTROLLER_PAIRING_SCREEN_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CONTROLLER_PAIRING_SCREEN_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 | 9 |
10 #include "chrome/browser/chromeos/login/screens/controller_pairing_screen_actor.
h" | 10 #include "chrome/browser/chromeos/login/screens/controller_pairing_screen_actor.
h" |
11 #include "chrome/browser/chromeos/login/screens/screen_context.h" | 11 #include "chrome/browser/chromeos/login/screens/screen_context.h" |
12 #include "chrome/browser/chromeos/login/screens/wizard_screen.h" | 12 #include "chrome/browser/chromeos/login/screens/wizard_screen.h" |
13 #include "chromeos/pairing/controller_pairing_controller.h" | 13 #include "components/pairing/controller_pairing_controller.h" |
14 | 14 |
15 namespace chromeos { | 15 namespace chromeos { |
16 | 16 |
17 class ControllerPairingScreen : public WizardScreen, | 17 class ControllerPairingScreen : |
18 public ControllerPairingController::Observer, | 18 public WizardScreen, |
19 public ControllerPairingScreenActor::Delegate { | 19 public pairing_chromeos::ControllerPairingController::Observer, |
| 20 public ControllerPairingScreenActor::Delegate { |
20 public: | 21 public: |
21 ControllerPairingScreen(ScreenObserver* observer, | 22 ControllerPairingScreen(ScreenObserver* observer, |
22 ControllerPairingScreenActor* actor); | 23 ControllerPairingScreenActor* actor); |
23 virtual ~ControllerPairingScreen(); | 24 virtual ~ControllerPairingScreen(); |
24 | 25 |
25 private: | 26 private: |
26 typedef ControllerPairingController::Stage Stage; | 27 typedef pairing_chromeos::ControllerPairingController::Stage Stage; |
27 | 28 |
28 void CommitContextChanges(); | 29 void CommitContextChanges(); |
29 bool ExpectStageIs(Stage stage) const; | 30 bool ExpectStageIs(Stage stage) const; |
30 | 31 |
31 // Overridden from WizardScreen: | 32 // Overridden from WizardScreen: |
32 virtual void PrepareToShow() OVERRIDE; | 33 virtual void PrepareToShow() OVERRIDE; |
33 virtual void Show() OVERRIDE; | 34 virtual void Show() OVERRIDE; |
34 virtual void Hide() OVERRIDE; | 35 virtual void Hide() OVERRIDE; |
35 virtual std::string GetName() const OVERRIDE; | 36 virtual std::string GetName() const OVERRIDE; |
36 | 37 |
37 // Overridden from ControllerPairingController::Observer: | 38 // Overridden from pairing_chromeos::ControllerPairingController::Observer: |
38 virtual void PairingStageChanged(Stage new_stage) OVERRIDE; | 39 virtual void PairingStageChanged(Stage new_stage) OVERRIDE; |
39 virtual void DiscoveredDevicesListChanged() OVERRIDE; | 40 virtual void DiscoveredDevicesListChanged() OVERRIDE; |
40 | 41 |
41 // Overridden from ControllerPairingView::Delegate: | 42 // Overridden from ControllerPairingView::Delegate: |
42 virtual void OnActorDestroyed(ControllerPairingScreenActor* actor) OVERRIDE; | 43 virtual void OnActorDestroyed(ControllerPairingScreenActor* actor) OVERRIDE; |
43 virtual void OnScreenContextChanged( | 44 virtual void OnScreenContextChanged( |
44 const base::DictionaryValue& diff) OVERRIDE; | 45 const base::DictionaryValue& diff) OVERRIDE; |
45 virtual void OnUserActed(const std::string& action) OVERRIDE; | 46 virtual void OnUserActed(const std::string& action) OVERRIDE; |
46 | 47 |
47 // Context for sharing data between C++ and JS. | 48 // Context for sharing data between C++ and JS. |
48 // TODO(dzhioev): move to BaseScreen when possible. | 49 // TODO(dzhioev): move to BaseScreen when possible. |
49 ScreenContext context_; | 50 ScreenContext context_; |
50 | 51 |
51 ControllerPairingScreenActor* actor_; | 52 ControllerPairingScreenActor* actor_; |
52 | 53 |
53 // Controller performing pairing. Owned by the screen for now. | 54 // Controller performing pairing. Owned by the screen for now. |
54 // TODO(dzhioev): move to proper place later. | 55 // TODO(dzhioev): move to proper place later. |
55 scoped_ptr<ControllerPairingController> controller_; | 56 scoped_ptr<pairing_chromeos::ControllerPairingController> controller_; |
56 | 57 |
57 // Current stage of pairing process. | 58 // Current stage of pairing process. |
58 Stage current_stage_; | 59 Stage current_stage_; |
59 | 60 |
60 // If this one is |false| first device in device list will be preselected on | 61 // If this one is |false| first device in device list will be preselected on |
61 // next device list update. | 62 // next device list update. |
62 bool device_preselected_; | 63 bool device_preselected_; |
63 | 64 |
64 DISALLOW_COPY_AND_ASSIGN(ControllerPairingScreen); | 65 DISALLOW_COPY_AND_ASSIGN(ControllerPairingScreen); |
65 }; | 66 }; |
66 | 67 |
67 } // namespace chromeos | 68 } // namespace chromeos |
68 | 69 |
69 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CONTROLLER_PAIRING_SCREEN_H_ | 70 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CONTROLLER_PAIRING_SCREEN_H_ |
OLD | NEW |