| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_ENROLLMENT_ENROLLMENT_SCREEN_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 class EnrollmentScreen | 39 class EnrollmentScreen |
| 40 : public BaseScreen, | 40 : public BaseScreen, |
| 41 public pairing_chromeos::HostPairingController::Observer, | 41 public pairing_chromeos::HostPairingController::Observer, |
| 42 public EnterpriseEnrollmentHelper::EnrollmentStatusConsumer, | 42 public EnterpriseEnrollmentHelper::EnrollmentStatusConsumer, |
| 43 public EnrollmentScreenActor::Controller { | 43 public EnrollmentScreenActor::Controller { |
| 44 public: | 44 public: |
| 45 typedef pairing_chromeos::HostPairingController::Stage Stage; | 45 typedef pairing_chromeos::HostPairingController::Stage Stage; |
| 46 | 46 |
| 47 EnrollmentScreen(BaseScreenDelegate* base_screen_delegate, | 47 EnrollmentScreen(BaseScreenDelegate* base_screen_delegate, |
| 48 EnrollmentScreenActor* actor); | 48 EnrollmentScreenActor* actor); |
| 49 virtual ~EnrollmentScreen(); | 49 ~EnrollmentScreen() override; |
| 50 | 50 |
| 51 static EnrollmentScreen* Get(ScreenManager* manager); | 51 static EnrollmentScreen* Get(ScreenManager* manager); |
| 52 | 52 |
| 53 // Setup how this screen will handle enrollment. | 53 // Setup how this screen will handle enrollment. |
| 54 // |shark_controller| is an interface that is used to communicate with a | 54 // |shark_controller| is an interface that is used to communicate with a |
| 55 // remora device for remote enrollment. | 55 // remora device for remote enrollment. |
| 56 // |remora_controller| is an interface that is used to communicate with a | 56 // |remora_controller| is an interface that is used to communicate with a |
| 57 // shark device for remote enrollment. | 57 // shark device for remote enrollment. |
| 58 void SetParameters( | 58 void SetParameters( |
| 59 const policy::EnrollmentConfig& enrollment_config, | 59 const policy::EnrollmentConfig& enrollment_config, |
| 60 pairing_chromeos::ControllerPairingController* shark_controller, | 60 pairing_chromeos::ControllerPairingController* shark_controller, |
| 61 pairing_chromeos::HostPairingController* remora_controller); | 61 pairing_chromeos::HostPairingController* remora_controller); |
| 62 | 62 |
| 63 // BaseScreen implementation: | 63 // BaseScreen implementation: |
| 64 virtual void PrepareToShow() override; | 64 void PrepareToShow() override; |
| 65 virtual void Show() override; | 65 void Show() override; |
| 66 virtual void Hide() override; | 66 void Hide() override; |
| 67 virtual std::string GetName() const override; | 67 std::string GetName() const override; |
| 68 | 68 |
| 69 // pairing_chromeos::HostPairingController::Observer: | 69 // pairing_chromeos::HostPairingController::Observer: |
| 70 virtual void PairingStageChanged(Stage new_stage) override; | 70 void PairingStageChanged(Stage new_stage) override; |
| 71 virtual void ConfigureHost(bool accepted_eula, | 71 void ConfigureHost(bool accepted_eula, |
| 72 const std::string& lang, | 72 const std::string& lang, |
| 73 const std::string& timezone, | 73 const std::string& timezone, |
| 74 bool send_reports, | 74 bool send_reports, |
| 75 const std::string& keyboard_layout) override; | 75 const std::string& keyboard_layout) override; |
| 76 virtual void EnrollHost(const std::string& auth_token) override; | 76 void EnrollHost(const std::string& auth_token) override; |
| 77 | 77 |
| 78 // EnrollmentScreenActor::Controller implementation: | 78 // EnrollmentScreenActor::Controller implementation: |
| 79 virtual void OnLoginDone(const std::string& user) override; | 79 void OnLoginDone(const std::string& user) override; |
| 80 virtual void OnRetry() override; | 80 void OnRetry() override; |
| 81 virtual void OnCancel() override; | 81 void OnCancel() override; |
| 82 virtual void OnConfirmationClosed() override; | 82 void OnConfirmationClosed() override; |
| 83 | 83 |
| 84 // EnterpriseEnrollmentHelper::EnrollmentStatusConsumer implementation: | 84 // EnterpriseEnrollmentHelper::EnrollmentStatusConsumer implementation: |
| 85 virtual void OnAuthError(const GoogleServiceAuthError& error) override; | 85 void OnAuthError(const GoogleServiceAuthError& error) override; |
| 86 virtual void OnEnrollmentError(policy::EnrollmentStatus status) override; | 86 void OnEnrollmentError(policy::EnrollmentStatus status) override; |
| 87 virtual void OnOtherError( | 87 void OnOtherError(EnterpriseEnrollmentHelper::OtherError error) override; |
| 88 EnterpriseEnrollmentHelper::OtherError error) override; | 88 void OnDeviceEnrolled(const std::string& additional_token) override; |
| 89 virtual void OnDeviceEnrolled(const std::string& additional_token) override; | |
| 90 | 89 |
| 91 // Used for testing. | 90 // Used for testing. |
| 92 EnrollmentScreenActor* GetActor() { | 91 EnrollmentScreenActor* GetActor() { |
| 93 return actor_; | 92 return actor_; |
| 94 } | 93 } |
| 95 | 94 |
| 96 private: | 95 private: |
| 97 FRIEND_TEST_ALL_PREFIXES(EnrollmentScreenTest, TestSuccess); | 96 FRIEND_TEST_ALL_PREFIXES(EnrollmentScreenTest, TestSuccess); |
| 98 | 97 |
| 99 // Creates an enrollment helper. | 98 // Creates an enrollment helper. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 scoped_ptr<base::ElapsedTimer> elapsed_timer_; | 131 scoped_ptr<base::ElapsedTimer> elapsed_timer_; |
| 133 scoped_ptr<EnterpriseEnrollmentHelper> enrollment_helper_; | 132 scoped_ptr<EnterpriseEnrollmentHelper> enrollment_helper_; |
| 134 base::WeakPtrFactory<EnrollmentScreen> weak_ptr_factory_; | 133 base::WeakPtrFactory<EnrollmentScreen> weak_ptr_factory_; |
| 135 | 134 |
| 136 DISALLOW_COPY_AND_ASSIGN(EnrollmentScreen); | 135 DISALLOW_COPY_AND_ASSIGN(EnrollmentScreen); |
| 137 }; | 136 }; |
| 138 | 137 |
| 139 } // namespace chromeos | 138 } // namespace chromeos |
| 140 | 139 |
| 141 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_H_ | 140 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_H_ |
| OLD | NEW |