OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 CHROMEOS_DBUS_BIOD_BIOD_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_BIOD_BIOD_CLIENT_H_ |
6 #define CHROMEOS_DBUS_BIOD_BIOD_CLIENT_H_ | 6 #define CHROMEOS_DBUS_BIOD_BIOD_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <unordered_map> | 9 #include <unordered_map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 const std::string& label, | 88 const std::string& label, |
89 const ObjectPathCallback& callback) = 0; | 89 const ObjectPathCallback& callback) = 0; |
90 | 90 |
91 // Gets all the records registered with this biometric. |callback| is called | 91 // Gets all the records registered with this biometric. |callback| is called |
92 // with all the object paths of the records with |user_id| after this method | 92 // with all the object paths of the records with |user_id| after this method |
93 // succeeds. |user_id| contains the unique identifier for the owner of the | 93 // succeeds. |user_id| contains the unique identifier for the owner of the |
94 // biometric. | 94 // biometric. |
95 virtual void GetRecordsForUser(const std::string& user_id, | 95 virtual void GetRecordsForUser(const std::string& user_id, |
96 const UserRecordsCallback& callback) = 0; | 96 const UserRecordsCallback& callback) = 0; |
97 | 97 |
98 // Irreversibly destroys all records registered. | 98 // Irreversibly destroys all records registered. |callback| is called |
99 virtual void DestroyAllRecords() = 0; | 99 // asynchronously with the result. |
| 100 virtual void DestroyAllRecords(const VoidDBusMethodCallback& callback) = 0; |
100 | 101 |
101 // Starts the biometric auth session. |callback| is called with the object | 102 // Starts the biometric auth session. |callback| is called with the object |
102 // path of the auth session after the method succeeds. | 103 // path of the auth session after the method succeeds. |
103 virtual void StartAuthSession(const ObjectPathCallback& callback) = 0; | 104 virtual void StartAuthSession(const ObjectPathCallback& callback) = 0; |
104 | 105 |
105 // Requests the type of biometric. |callback| is called with the biometric | 106 // Requests the type of biometric. |callback| is called with the biometric |
106 // type after the method succeeds. | 107 // type after the method succeeds. |
107 virtual void RequestType(const BiometricTypeCallback& callback) = 0; | 108 virtual void RequestType(const BiometricTypeCallback& callback) = 0; |
108 | 109 |
109 // Cancels the enroll session at |enroll_session_path|. | 110 // Cancels the enroll session at |enroll_session_path|. |callback| is called |
110 virtual void CancelEnrollSession( | 111 // asynchronously with the result. |
111 const dbus::ObjectPath& enroll_session_path) = 0; | 112 virtual void CancelEnrollSession(const dbus::ObjectPath& enroll_session_path, |
| 113 const VoidDBusMethodCallback& callback) = 0; |
112 | 114 |
113 // Ends the auth session at |auth_session_path|. | 115 // Ends the auth session at |auth_session_path|. |callback| is called |
114 virtual void EndAuthSession(const dbus::ObjectPath& auth_session_path) = 0; | 116 // asynchronously with the result. |
| 117 virtual void EndAuthSession(const dbus::ObjectPath& auth_session_path, |
| 118 const VoidDBusMethodCallback& callback) = 0; |
115 | 119 |
116 // Changes the label of the record at |record_path| to |label|. | 120 // Changes the label of the record at |record_path| to |label|. |callback| is |
| 121 // called asynchronously with the result. |
117 virtual void SetRecordLabel(const dbus::ObjectPath& record_path, | 122 virtual void SetRecordLabel(const dbus::ObjectPath& record_path, |
118 const std::string& label) = 0; | 123 const std::string& label, |
| 124 const VoidDBusMethodCallback& callback) = 0; |
119 | 125 |
120 // Removes the record at |record_path|. This record will no longer be able to | 126 // Removes the record at |record_path|. This record will no longer be able to |
121 // used for authentication. | 127 // used for authentication. |callback| is called asynchronously with the |
122 virtual void RemoveRecord(const dbus::ObjectPath& record_path) = 0; | 128 // result. |
| 129 virtual void RemoveRecord(const dbus::ObjectPath& record_path, |
| 130 const VoidDBusMethodCallback& callback) = 0; |
123 | 131 |
124 // Requests the label of the record at |record_path|. |callback| is called | 132 // Requests the label of the record at |record_path|. |callback| is called |
125 // with the label of the record. | 133 // with the label of the record. |
126 virtual void RequestRecordLabel(const dbus::ObjectPath& record_path, | 134 virtual void RequestRecordLabel(const dbus::ObjectPath& record_path, |
127 const LabelCallback& callback) = 0; | 135 const LabelCallback& callback) = 0; |
128 | 136 |
129 // Creates the instance. | 137 // Creates the instance. |
130 static BiodClient* Create(DBusClientImplementationType type); | 138 static BiodClient* Create(DBusClientImplementationType type); |
131 | 139 |
132 protected: | 140 protected: |
133 friend class BiodClientTest; | 141 friend class BiodClientTest; |
134 | 142 |
135 // Create() should be used instead. | 143 // Create() should be used instead. |
136 BiodClient(); | 144 BiodClient(); |
137 | 145 |
138 private: | 146 private: |
139 DISALLOW_COPY_AND_ASSIGN(BiodClient); | 147 DISALLOW_COPY_AND_ASSIGN(BiodClient); |
140 }; | 148 }; |
141 | 149 |
142 } // namespace chromeos | 150 } // namespace chromeos |
143 | 151 |
144 #endif // CHROMEOS_DBUS_BIOD_BIOD_CLIENT_H_ | 152 #endif // CHROMEOS_DBUS_BIOD_BIOD_CLIENT_H_ |
OLD | NEW |