| 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" |
| 11 | 11 |
| 12 namespace pairing_chromeos { | 12 namespace pairing_chromeos { |
| 13 | 13 |
| 14 class HostPairingController { | 14 class HostPairingController { |
| 15 public: | 15 public: |
| 16 enum Stage { | 16 enum Stage { |
| 17 STAGE_NONE, | 17 STAGE_NONE, |
| 18 STAGE_INITIALIZATION_ERROR, | 18 STAGE_INITIALIZATION_ERROR, |
| 19 STAGE_WAITING_FOR_CONTROLLER, | 19 STAGE_WAITING_FOR_CONTROLLER, |
| 20 STAGE_WAITING_FOR_CODE_CONFIRMATION, | 20 STAGE_WAITING_FOR_CODE_CONFIRMATION, |
| 21 STAGE_SETUP_BASIC_CONFIGURATION, |
| 22 STAGE_SETUP_NETWORK_ERROR, |
| 21 STAGE_WAITING_FOR_CONTROLLER_AFTER_UPDATE, | 23 STAGE_WAITING_FOR_CONTROLLER_AFTER_UPDATE, |
| 22 STAGE_WAITING_FOR_CREDENTIALS, | 24 STAGE_WAITING_FOR_CREDENTIALS, |
| 23 STAGE_ENROLLING, | 25 STAGE_ENROLLING, |
| 24 STAGE_ENROLLMENT_ERROR, | 26 STAGE_ENROLLMENT_ERROR, |
| 25 STAGE_ENROLLMENT_SUCCESS, | 27 STAGE_ENROLLMENT_SUCCESS, |
| 26 STAGE_FINISHED | 28 STAGE_FINISHED |
| 27 }; | 29 }; |
| 28 | 30 |
| 31 enum Connectivity { |
| 32 CONNECTIVITY_UNTESTED, |
| 33 CONNECTIVITY_NONE, |
| 34 CONNECTIVITY_LIMITED, |
| 35 CONNECTIVITY_CONNECTING, |
| 36 CONNECTIVITY_CONNECTED, |
| 37 }; |
| 38 |
| 29 enum UpdateStatus { | 39 enum UpdateStatus { |
| 30 UPDATE_STATUS_UNKNOWN, | 40 UPDATE_STATUS_UNKNOWN, |
| 31 UPDATE_STATUS_UPDATING, | 41 UPDATE_STATUS_UPDATING, |
| 32 UPDATE_STATUS_REBOOTING, | 42 UPDATE_STATUS_REBOOTING, |
| 33 UPDATE_STATUS_UPDATED, | 43 UPDATE_STATUS_UPDATED, |
| 34 }; | 44 }; |
| 35 | 45 |
| 36 enum EnrollmentStatus { | 46 enum EnrollmentStatus { |
| 37 ENROLLMENT_STATUS_UNKNOWN, | 47 ENROLLMENT_STATUS_UNKNOWN, |
| 38 ENROLLMENT_STATUS_ENROLLING, | 48 ENROLLMENT_STATUS_ENROLLING, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 virtual std::string GetDeviceName() = 0; | 88 virtual std::string GetDeviceName() = 0; |
| 79 | 89 |
| 80 // Returns 6-digit confirmation code. Can be called only on | 90 // Returns 6-digit confirmation code. Can be called only on |
| 81 // |STAGE_WAITING_FOR_CODE_CONFIRMATION| stage. | 91 // |STAGE_WAITING_FOR_CODE_CONFIRMATION| stage. |
| 82 virtual std::string GetConfirmationCode() = 0; | 92 virtual std::string GetConfirmationCode() = 0; |
| 83 | 93 |
| 84 // Returns an enrollment domain name. Can be called on stage | 94 // Returns an enrollment domain name. Can be called on stage |
| 85 // |STAGE_ENROLLMENT| and later. | 95 // |STAGE_ENROLLMENT| and later. |
| 86 virtual std::string GetEnrollmentDomain() = 0; | 96 virtual std::string GetEnrollmentDomain() = 0; |
| 87 | 97 |
| 98 // Notify that the network connectivity status has changed. |
| 99 virtual void OnNetworkConnectivityChanged( |
| 100 Connectivity connectivity_status) = 0; |
| 101 |
| 88 // Notify that the update status has changed. | 102 // Notify that the update status has changed. |
| 89 virtual void OnUpdateStatusChanged(UpdateStatus update_status) = 0; | 103 virtual void OnUpdateStatusChanged(UpdateStatus update_status) = 0; |
| 90 | 104 |
| 91 // Notify that enrollment status has changed. | 105 // Notify that enrollment status has changed. |
| 92 // Can be called on stage |STAGE_WAITING_FOR_CREDENTIALS|. | 106 // Can be called on stage |STAGE_WAITING_FOR_CREDENTIALS|. |
| 93 virtual void OnEnrollmentStatusChanged( | 107 virtual void OnEnrollmentStatusChanged( |
| 94 EnrollmentStatus enrollment_status) = 0; | 108 EnrollmentStatus enrollment_status) = 0; |
| 95 | 109 |
| 96 // Set the permanent id assigned during enrollment. | 110 // Set the permanent id assigned during enrollment. |
| 97 virtual void SetPermanentId(const std::string& permanent_id) = 0; | 111 virtual void SetPermanentId(const std::string& permanent_id) = 0; |
| 98 | 112 |
| 99 virtual void AddObserver(Observer* observer) = 0; | 113 virtual void AddObserver(Observer* observer) = 0; |
| 100 virtual void RemoveObserver(Observer* observer) = 0; | 114 virtual void RemoveObserver(Observer* observer) = 0; |
| 101 | 115 |
| 102 private: | 116 private: |
| 103 DISALLOW_COPY_AND_ASSIGN(HostPairingController); | 117 DISALLOW_COPY_AND_ASSIGN(HostPairingController); |
| 104 }; | 118 }; |
| 105 | 119 |
| 106 } // namespace pairing_chromeos | 120 } // namespace pairing_chromeos |
| 107 | 121 |
| 108 #endif // COMPONENTS_PAIRING_HOST_PAIRING_CONTROLLER_H_ | 122 #endif // COMPONENTS_PAIRING_HOST_PAIRING_CONTROLLER_H_ |
| OLD | NEW |