Chromium Code Reviews| 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 with |
|
Daniel Erat
2017/04/08 00:12:34
i'd change the second sentence to something simple
sammiequon
2017/04/08 01:03:30
Done.
| |
| 99 virtual void DestroyAllRecords() = 0; | 99 // D-Bus failure if there is a D-Bus error along the way; called with D-Bus |
| 100 // success otherwise. | |
| 101 | |
|
Daniel Erat
2017/04/08 00:12:34
delete blank line
sammiequon
2017/04/08 01:03:30
Done.
| |
| 102 virtual void DestroyAllRecords(const VoidDBusMethodCallback& callback) = 0; | |
| 100 | 103 |
| 101 // Starts the biometric auth session. |callback| is called with the object | 104 // Starts the biometric auth session. |callback| is called with the object |
| 102 // path of the auth session after the method succeeds. | 105 // path of the auth session after the method succeeds. |
| 103 virtual void StartAuthSession(const ObjectPathCallback& callback) = 0; | 106 virtual void StartAuthSession(const ObjectPathCallback& callback) = 0; |
| 104 | 107 |
| 105 // Requests the type of biometric. |callback| is called with the biometric | 108 // Requests the type of biometric. |callback| is called with the biometric |
| 106 // type after the method succeeds. | 109 // type after the method succeeds. |
| 107 virtual void RequestType(const BiometricTypeCallback& callback) = 0; | 110 virtual void RequestType(const BiometricTypeCallback& callback) = 0; |
| 108 | 111 |
| 109 // Cancels the enroll session at |enroll_session_path|. | 112 // Cancels the enroll session at |enroll_session_path|. |callback| is called |
| 110 virtual void CancelEnrollSession( | 113 // with D-Bus failure if there is a D-Bus error along the way; called with |
| 111 const dbus::ObjectPath& enroll_session_path) = 0; | 114 // D-Bus success otherwise. |
| 112 | 115 |
|
Daniel Erat
2017/04/08 00:12:34
delete blank line
sammiequon
2017/04/08 01:03:30
Oops, done.
| |
| 113 // Ends the auth session at |auth_session_path|. | 116 virtual void CancelEnrollSession(const dbus::ObjectPath& enroll_session_path, |
| 114 virtual void EndAuthSession(const dbus::ObjectPath& auth_session_path) = 0; | 117 const VoidDBusMethodCallback& callback) = 0; |
| 115 | 118 |
| 116 // Changes the label of the record at |record_path| to |label|. | 119 // Ends the auth session at |auth_session_path|. |callback| is called with |
| 120 // D-Bus failure if there is a D-Bus error along the way; called with D-Bus | |
| 121 // success otherwise. | |
| 122 | |
|
Daniel Erat
2017/04/08 00:12:34
delete blank line
sammiequon
2017/04/08 01:03:30
Done.
| |
| 123 virtual void EndAuthSession(const dbus::ObjectPath& auth_session_path, | |
| 124 const VoidDBusMethodCallback& callback) = 0; | |
| 125 | |
| 126 // Changes the label of the record at |record_path| to |label|. |callback| is | |
| 127 // called with D-Bus failure if there is a D-Bus error along the way; called | |
| 128 // with D-Bus success otherwise. | |
| 129 | |
|
Daniel Erat
2017/04/08 00:12:34
delete blank line
sammiequon
2017/04/08 01:03:30
Done.
| |
| 117 virtual void SetRecordLabel(const dbus::ObjectPath& record_path, | 130 virtual void SetRecordLabel(const dbus::ObjectPath& record_path, |
| 118 const std::string& label) = 0; | 131 const std::string& label, |
| 132 const VoidDBusMethodCallback& callback) = 0; | |
| 119 | 133 |
| 120 // Removes the record at |record_path|. This record will no longer be able to | 134 // Removes the record at |record_path|. This record will no longer be able to |
| 121 // used for authentication. | 135 // used for authentication. |callback| is called with D-Bus failure if there |
| 122 virtual void RemoveRecord(const dbus::ObjectPath& record_path) = 0; | 136 // is a D-Bus error along the way; called with D-Bus success otherwise. |
| 137 virtual void RemoveRecord(const dbus::ObjectPath& record_path, | |
| 138 const VoidDBusMethodCallback& callback) = 0; | |
| 123 | 139 |
| 124 // Requests the label of the record at |record_path|. |callback| is called | 140 // Requests the label of the record at |record_path|. |callback| is called |
| 125 // with the label of the record. | 141 // with the label of the record. |
| 126 virtual void RequestRecordLabel(const dbus::ObjectPath& record_path, | 142 virtual void RequestRecordLabel(const dbus::ObjectPath& record_path, |
| 127 const LabelCallback& callback) = 0; | 143 const LabelCallback& callback) = 0; |
| 128 | 144 |
| 129 // Creates the instance. | 145 // Creates the instance. |
| 130 static BiodClient* Create(DBusClientImplementationType type); | 146 static BiodClient* Create(DBusClientImplementationType type); |
| 131 | 147 |
| 132 protected: | 148 protected: |
| 133 friend class BiodClientTest; | 149 friend class BiodClientTest; |
| 134 | 150 |
| 135 // Create() should be used instead. | 151 // Create() should be used instead. |
| 136 BiodClient(); | 152 BiodClient(); |
| 137 | 153 |
| 138 private: | 154 private: |
| 139 DISALLOW_COPY_AND_ASSIGN(BiodClient); | 155 DISALLOW_COPY_AND_ASSIGN(BiodClient); |
| 140 }; | 156 }; |
| 141 | 157 |
| 142 } // namespace chromeos | 158 } // namespace chromeos |
| 143 | 159 |
| 144 #endif // CHROMEOS_DBUS_BIOD_BIOD_CLIENT_H_ | 160 #endif // CHROMEOS_DBUS_BIOD_BIOD_CLIENT_H_ |
| OLD | NEW |