| 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_view.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 ControllerPairingScreenView::Delegate { |
| 21 public: | 21 public: |
| 22 class Delegate { | 22 class Delegate { |
| 23 public: | 23 public: |
| 24 virtual ~Delegate() {} | 24 virtual ~Delegate() {} |
| 25 | 25 |
| 26 // Set remora network from shark. | 26 // Set remora network from shark. |
| 27 virtual void SetHostNetwork() = 0; | 27 virtual void SetHostNetwork() = 0; |
| 28 | 28 |
| 29 // Set remora configuration from shark. | 29 // Set remora configuration from shark. |
| 30 virtual void SetHostConfiguration() = 0; | 30 virtual void SetHostConfiguration() = 0; |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 ControllerPairingScreen( | 33 ControllerPairingScreen( |
| 34 BaseScreenDelegate* base_screen_delegate, | 34 BaseScreenDelegate* base_screen_delegate, |
| 35 Delegate* delegate, | 35 Delegate* delegate, |
| 36 ControllerPairingScreenActor* actor, | 36 ControllerPairingScreenView* view, |
| 37 pairing_chromeos::ControllerPairingController* shark_controller); | 37 pairing_chromeos::ControllerPairingController* shark_controller); |
| 38 ~ControllerPairingScreen() override; | 38 ~ControllerPairingScreen() override; |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 typedef pairing_chromeos::ControllerPairingController::Stage Stage; | 41 typedef pairing_chromeos::ControllerPairingController::Stage Stage; |
| 42 | 42 |
| 43 void CommitContextChanges(); | 43 void CommitContextChanges(); |
| 44 bool ExpectStageIs(Stage stage) const; | 44 bool ExpectStageIs(Stage stage) const; |
| 45 | 45 |
| 46 // Overridden from BaseScreen: | 46 // Overridden from BaseScreen: |
| 47 void Show() override; | 47 void Show() override; |
| 48 void Hide() override; | 48 void Hide() override; |
| 49 | 49 |
| 50 // Overridden from pairing_chromeos::ControllerPairingController::Observer: | 50 // Overridden from pairing_chromeos::ControllerPairingController::Observer: |
| 51 void PairingStageChanged(Stage new_stage) override; | 51 void PairingStageChanged(Stage new_stage) override; |
| 52 void DiscoveredDevicesListChanged() override; | 52 void DiscoveredDevicesListChanged() override; |
| 53 | 53 |
| 54 // Overridden from ControllerPairingView::Delegate: | 54 // Overridden from ControllerPairingView::Delegate: |
| 55 void OnActorDestroyed(ControllerPairingScreenActor* actor) override; | 55 void OnViewDestroyed(ControllerPairingScreenView* view) override; |
| 56 void OnScreenContextChanged(const base::DictionaryValue& diff) override; | 56 void OnScreenContextChanged(const base::DictionaryValue& diff) override; |
| 57 void OnUserActed(const std::string& action) override; | 57 void OnUserActed(const std::string& action) override; |
| 58 | 58 |
| 59 Delegate* delegate_; | 59 Delegate* delegate_; |
| 60 | 60 |
| 61 ControllerPairingScreenActor* actor_; | 61 ControllerPairingScreenView* view_; |
| 62 | 62 |
| 63 // Controller performing pairing. Owned by the wizard controller. | 63 // Controller performing pairing. Owned by the wizard controller. |
| 64 pairing_chromeos::ControllerPairingController* shark_controller_; | 64 pairing_chromeos::ControllerPairingController* shark_controller_; |
| 65 | 65 |
| 66 // Current stage of pairing process. | 66 // Current stage of pairing process. |
| 67 Stage current_stage_; | 67 Stage current_stage_; |
| 68 | 68 |
| 69 // If this one is |false| first device in device list will be preselected on | 69 // If this one is |false| first device in device list will be preselected on |
| 70 // next device list update. | 70 // next device list update. |
| 71 bool device_preselected_; | 71 bool device_preselected_; |
| 72 | 72 |
| 73 DISALLOW_COPY_AND_ASSIGN(ControllerPairingScreen); | 73 DISALLOW_COPY_AND_ASSIGN(ControllerPairingScreen); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 } // namespace chromeos | 76 } // namespace chromeos |
| 77 | 77 |
| 78 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CONTROLLER_PAIRING_SCREEN_H_ | 78 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CONTROLLER_PAIRING_SCREEN_H_ |
| OLD | NEW |