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 COMPONENTS_PAIRING_FAKE_HOST_PAIRING_CONTROLLER_H_ | 5 #ifndef COMPONENTS_PAIRING_FAKE_HOST_PAIRING_CONTROLLER_H_ |
6 #define COMPONENTS_PAIRING_FAKE_HOST_PAIRING_CONTROLLER_H_ | 6 #define COMPONENTS_PAIRING_FAKE_HOST_PAIRING_CONTROLLER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 void ApplyConfig(const std::string& config); | 34 void ApplyConfig(const std::string& config); |
35 | 35 |
36 // Overridden from HostPairingFlow: | 36 // Overridden from HostPairingFlow: |
37 virtual void AddObserver(Observer* observer) OVERRIDE; | 37 virtual void AddObserver(Observer* observer) OVERRIDE; |
38 virtual void RemoveObserver(Observer* observer) OVERRIDE; | 38 virtual void RemoveObserver(Observer* observer) OVERRIDE; |
39 virtual Stage GetCurrentStage() OVERRIDE; | 39 virtual Stage GetCurrentStage() OVERRIDE; |
40 virtual void StartPairing() OVERRIDE; | 40 virtual void StartPairing() OVERRIDE; |
41 virtual std::string GetDeviceName() OVERRIDE; | 41 virtual std::string GetDeviceName() OVERRIDE; |
42 virtual std::string GetConfirmationCode() OVERRIDE; | 42 virtual std::string GetConfirmationCode() OVERRIDE; |
43 virtual std::string GetEnrollmentDomain() OVERRIDE; | 43 virtual std::string GetEnrollmentDomain() OVERRIDE; |
| 44 virtual void OnUpdateStatusChanged(UpdateStatus update_status) OVERRIDE; |
44 | 45 |
45 private: | 46 private: |
46 void ChangeStage(Stage new_stage); | 47 void ChangeStage(Stage new_stage); |
47 void ChangeStageLater(Stage new_stage); | 48 void ChangeStageLater(Stage new_stage); |
48 void SetUpdateProgress(int step); | |
49 | 49 |
50 // Overridden from HostPairingFlow::Observer: | 50 // HostPairingFlow::Observer: |
51 virtual void PairingStageChanged(Stage new_stage) OVERRIDE; | 51 virtual void PairingStageChanged(Stage new_stage) OVERRIDE; |
52 virtual void UpdateAdvanced(const UpdateProgress& progress) OVERRIDE; | 52 virtual void ConfigureHost(bool accepted_eula, |
| 53 const std::string& lang, |
| 54 const std::string& timezone, |
| 55 bool send_reports, |
| 56 const std::string& keyboard_layout) OVERRIDE; |
| 57 virtual void EnrollHost(const std::string& auth_token) OVERRIDE; |
53 | 58 |
54 ObserverList<Observer> observers_; | 59 ObserverList<Observer> observers_; |
55 Stage current_stage_; | 60 Stage current_stage_; |
56 std::string device_name_; | 61 std::string device_name_; |
57 std::string confirmation_code_; | 62 std::string confirmation_code_; |
58 base::TimeDelta async_duration_; | 63 base::TimeDelta async_duration_; |
59 | 64 |
60 // If this flag is true error happens on |STAGE_ENROLLING| once. | 65 // If this flag is true error happens on |STAGE_ENROLLING| once. |
61 bool enrollment_should_fail_; | 66 bool enrollment_should_fail_; |
62 | 67 |
63 // Controller starts its work like if update and reboot already happened. | 68 // Controller starts its work like if update and reboot already happened. |
64 bool start_after_update_; | 69 bool start_after_update_; |
65 | 70 |
66 std::string enrollment_domain_; | 71 std::string enrollment_domain_; |
67 | 72 |
68 DISALLOW_COPY_AND_ASSIGN(FakeHostPairingController); | 73 DISALLOW_COPY_AND_ASSIGN(FakeHostPairingController); |
69 }; | 74 }; |
70 | 75 |
71 } // namespace pairing_chromeos | 76 } // namespace pairing_chromeos |
72 | 77 |
73 #endif // COMPONENTS_PAIRING_FAKE_HOST_PAIRING_CONTROLLER_H_ | 78 #endif // COMPONENTS_PAIRING_FAKE_HOST_PAIRING_CONTROLLER_H_ |
OLD | NEW |