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_HOST_PAIRING_CONTROLLER_H_ | 5 #ifndef COMPONENTS_PAIRING_HOST_PAIRING_CONTROLLER_H_ |
6 #define COMPONENTS_PAIRING_HOST_PAIRING_CONTROLLER_H_ | 6 #define COMPONENTS_PAIRING_HOST_PAIRING_CONTROLLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 STAGE_FINISHED | 27 STAGE_FINISHED |
28 }; | 28 }; |
29 | 29 |
30 enum UpdateStatus { | 30 enum UpdateStatus { |
31 UPDATE_STATUS_UNKNOWN, | 31 UPDATE_STATUS_UNKNOWN, |
32 UPDATE_STATUS_UPDATING, | 32 UPDATE_STATUS_UPDATING, |
33 UPDATE_STATUS_REBOOTING, | 33 UPDATE_STATUS_REBOOTING, |
34 UPDATE_STATUS_UPDATED, | 34 UPDATE_STATUS_UPDATED, |
35 }; | 35 }; |
36 | 36 |
| 37 enum EnrollmentStatus { |
| 38 ENROLLMENT_STATUS_UNKNOWN, |
| 39 ENROLLMENT_STATUS_ENROLLING, |
| 40 ENROLLMENT_STATUS_FAILURE, |
| 41 ENROLLMENT_STATUS_SUCCESS, |
| 42 }; |
| 43 |
37 class Observer { | 44 class Observer { |
38 public: | 45 public: |
39 Observer(); | 46 Observer(); |
40 virtual ~Observer(); | 47 virtual ~Observer(); |
41 | 48 |
42 // Called when pairing has moved on from one stage to another. | 49 // Called when pairing has moved on from one stage to another. |
43 virtual void PairingStageChanged(Stage new_stage) = 0; | 50 virtual void PairingStageChanged(Stage new_stage) = 0; |
44 | 51 |
45 // Called when the controller has sent a configuration to apply. | 52 // Called when the controller has sent a configuration to apply. |
46 virtual void ConfigureHost(bool accepted_eula, | 53 virtual void ConfigureHost(bool accepted_eula, |
(...skipping 26 matching lines...) Expand all Loading... |
73 virtual std::string GetConfirmationCode() = 0; | 80 virtual std::string GetConfirmationCode() = 0; |
74 | 81 |
75 // Returns an enrollment domain name. Can be called on stage | 82 // Returns an enrollment domain name. Can be called on stage |
76 // |STAGE_ENROLLMENT| and later. | 83 // |STAGE_ENROLLMENT| and later. |
77 virtual std::string GetEnrollmentDomain() = 0; | 84 virtual std::string GetEnrollmentDomain() = 0; |
78 | 85 |
79 // Notify that the update status has changed. | 86 // Notify that the update status has changed. |
80 // Can be called on stage |STAGE_UPDATING|. | 87 // Can be called on stage |STAGE_UPDATING|. |
81 virtual void OnUpdateStatusChanged(UpdateStatus update_status) = 0; | 88 virtual void OnUpdateStatusChanged(UpdateStatus update_status) = 0; |
82 | 89 |
83 // Called when enrollment has completed. | 90 // Notify that enrollment status has changed. |
84 virtual void SetEnrollmentComplete(bool success) = 0; | 91 // Can be called on stage |STAGE_WAITING_FOR_CREDENTIALS|. |
| 92 virtual void OnEnrollmentStatusChanged( |
| 93 EnrollmentStatus enrollment_status) = 0; |
85 | 94 |
86 virtual void AddObserver(Observer* observer) = 0; | 95 virtual void AddObserver(Observer* observer) = 0; |
87 virtual void RemoveObserver(Observer* observer) = 0; | 96 virtual void RemoveObserver(Observer* observer) = 0; |
88 | 97 |
89 private: | 98 private: |
90 DISALLOW_COPY_AND_ASSIGN(HostPairingController); | 99 DISALLOW_COPY_AND_ASSIGN(HostPairingController); |
91 }; | 100 }; |
92 | 101 |
93 } // namespace pairing_chromeos | 102 } // namespace pairing_chromeos |
94 | 103 |
95 #endif // COMPONENTS_PAIRING_HOST_PAIRING_CONTROLLER_H_ | 104 #endif // COMPONENTS_PAIRING_HOST_PAIRING_CONTROLLER_H_ |
OLD | NEW |