Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(588)

Side by Side Diff: components/pairing/host_pairing_controller.h

Issue 2890383003: Bootstrapping: Send meaningful error code/message from Slave to Master (Closed)
Patch Set: . Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 UPDATE_STATUS_UPDATED, 44 UPDATE_STATUS_UPDATED,
45 }; 45 };
46 46
47 enum EnrollmentStatus { 47 enum EnrollmentStatus {
48 ENROLLMENT_STATUS_UNKNOWN, 48 ENROLLMENT_STATUS_UNKNOWN,
49 ENROLLMENT_STATUS_ENROLLING, 49 ENROLLMENT_STATUS_ENROLLING,
50 ENROLLMENT_STATUS_FAILURE, 50 ENROLLMENT_STATUS_FAILURE,
51 ENROLLMENT_STATUS_SUCCESS, 51 ENROLLMENT_STATUS_SUCCESS,
52 }; 52 };
53 53
54 enum ErrorCode {
achuithb 2017/05/25 19:25:54 We now prefer enum class.
xdai1 2017/06/08 22:18:41 Done. I'll update the other enums in another CL to
55 ERROR_NONE = 0,
56 NETWORK_ERROR,
57 AUTH_ERROR,
58 ENROLL_ERROR,
59 OTHER_ERROR,
60 };
61
54 class Observer { 62 class Observer {
55 public: 63 public:
56 Observer(); 64 Observer();
57 virtual ~Observer(); 65 virtual ~Observer();
58 66
59 // Called when pairing has moved on from one stage to another. 67 // Called when pairing has moved on from one stage to another.
60 virtual void PairingStageChanged(Stage new_stage) = 0; 68 virtual void PairingStageChanged(Stage new_stage) = 0;
61 69
62 // Called when the controller has sent a configuration to apply. 70 // Called when the controller has sent a configuration to apply.
63 virtual void ConfigureHostRequested(bool accepted_eula, 71 virtual void ConfigureHostRequested(bool accepted_eula,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 virtual void OnUpdateStatusChanged(UpdateStatus update_status) = 0; 112 virtual void OnUpdateStatusChanged(UpdateStatus update_status) = 0;
105 113
106 // Notify that enrollment status has changed. 114 // Notify that enrollment status has changed.
107 // Can be called on stage |STAGE_WAITING_FOR_CREDENTIALS|. 115 // Can be called on stage |STAGE_WAITING_FOR_CREDENTIALS|.
108 virtual void OnEnrollmentStatusChanged( 116 virtual void OnEnrollmentStatusChanged(
109 EnrollmentStatus enrollment_status) = 0; 117 EnrollmentStatus enrollment_status) = 0;
110 118
111 // Set the permanent id assigned during enrollment. 119 // Set the permanent id assigned during enrollment.
112 virtual void SetPermanentId(const std::string& permanent_id) = 0; 120 virtual void SetPermanentId(const std::string& permanent_id) = 0;
113 121
122 virtual void SetErrorCodeAndMessage(int error_code,
123 const std::string& error_message) = 0;
124
114 // Reset the controller. 125 // Reset the controller.
115 virtual void Reset() = 0; 126 virtual void Reset() = 0;
116 127
117 virtual void AddObserver(Observer* observer) = 0; 128 virtual void AddObserver(Observer* observer) = 0;
118 virtual void RemoveObserver(Observer* observer) = 0; 129 virtual void RemoveObserver(Observer* observer) = 0;
119 130
120 private: 131 private:
121 DISALLOW_COPY_AND_ASSIGN(HostPairingController); 132 DISALLOW_COPY_AND_ASSIGN(HostPairingController);
122 }; 133 };
123 134
124 } // namespace pairing_chromeos 135 } // namespace pairing_chromeos
125 136
126 #endif // COMPONENTS_PAIRING_HOST_PAIRING_CONTROLLER_H_ 137 #endif // COMPONENTS_PAIRING_HOST_PAIRING_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698