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/base_screen.h" | 10 #include "chrome/browser/chromeos/login/screens/base_screen.h" |
11 #include "chrome/browser/chromeos/login/screens/controller_pairing_screen_actor. h" | 11 #include "chrome/browser/chromeos/login/screens/controller_pairing_screen_actor. h" |
12 #include "components/login/screens/screen_context.h" | 12 #include "components/login/screens/screen_context.h" |
13 #include "components/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 | 17 class ControllerPairingScreen |
18 : public BaseScreen, | 18 : public BaseScreen, |
19 public pairing_chromeos::ControllerPairingController::Observer, | 19 public pairing_chromeos::ControllerPairingController::Observer, |
20 public ControllerPairingScreenActor::Delegate { | 20 public ControllerPairingScreenActor::Delegate { |
21 public: | 21 public: |
22 class Delegate { | |
23 public: | |
24 virtual ~Delegate() {} | |
achuithb
2014/10/27 18:50:57
nit: I believe this could be made protected
| |
25 | |
26 // Set remora configuration from shark. | |
27 virtual void SetHostConfiguration() = 0; | |
28 }; | |
29 | |
22 ControllerPairingScreen( | 30 ControllerPairingScreen( |
23 ScreenObserver* observer, | 31 ScreenObserver* observer, |
24 ControllerPairingScreenActor* actor, | 32 ControllerPairingScreenActor* actor, |
25 pairing_chromeos::ControllerPairingController* shark_controller); | 33 pairing_chromeos::ControllerPairingController* shark_controller); |
26 virtual ~ControllerPairingScreen(); | 34 virtual ~ControllerPairingScreen(); |
27 | 35 |
36 void SetDelegate(Delegate* delegate); | |
achuithb
2014/10/27 18:50:57
I would just pass in the delegate in the ctor inst
| |
37 | |
28 private: | 38 private: |
29 typedef pairing_chromeos::ControllerPairingController::Stage Stage; | 39 typedef pairing_chromeos::ControllerPairingController::Stage Stage; |
30 | 40 |
31 void CommitContextChanges(); | 41 void CommitContextChanges(); |
32 bool ExpectStageIs(Stage stage) const; | 42 bool ExpectStageIs(Stage stage) const; |
33 | 43 |
34 // Overridden from BaseScreen: | 44 // Overridden from BaseScreen: |
35 virtual void PrepareToShow() override; | 45 virtual void PrepareToShow() override; |
36 virtual void Show() override; | 46 virtual void Show() override; |
37 virtual void Hide() override; | 47 virtual void Hide() override; |
(...skipping 11 matching lines...) Expand all Loading... | |
49 | 59 |
50 // Context for sharing data between C++ and JS. | 60 // Context for sharing data between C++ and JS. |
51 // TODO(dzhioev): move to BaseScreen when possible. | 61 // TODO(dzhioev): move to BaseScreen when possible. |
52 ::login::ScreenContext context_; | 62 ::login::ScreenContext context_; |
53 | 63 |
54 ControllerPairingScreenActor* actor_; | 64 ControllerPairingScreenActor* actor_; |
55 | 65 |
56 // Controller performing pairing. Owned by the wizard controller. | 66 // Controller performing pairing. Owned by the wizard controller. |
57 pairing_chromeos::ControllerPairingController* shark_controller_; | 67 pairing_chromeos::ControllerPairingController* shark_controller_; |
58 | 68 |
69 Delegate* delegate_; | |
70 | |
59 // Current stage of pairing process. | 71 // Current stage of pairing process. |
60 Stage current_stage_; | 72 Stage current_stage_; |
61 | 73 |
62 // If this one is |false| first device in device list will be preselected on | 74 // If this one is |false| first device in device list will be preselected on |
63 // next device list update. | 75 // next device list update. |
64 bool device_preselected_; | 76 bool device_preselected_; |
65 | 77 |
66 DISALLOW_COPY_AND_ASSIGN(ControllerPairingScreen); | 78 DISALLOW_COPY_AND_ASSIGN(ControllerPairingScreen); |
67 }; | 79 }; |
68 | 80 |
69 } // namespace chromeos | 81 } // namespace chromeos |
70 | 82 |
71 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CONTROLLER_PAIRING_SCREEN_H_ | 83 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CONTROLLER_PAIRING_SCREEN_H_ |
OLD | NEW |