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 |
| 99 virtual void DestroyAllRecords() = 0; | 99 // asynchronosly with the result. |
|
Daniel Erat
2017/04/08 01:13:32
nit: asynchronously (note 'u', also add below)
sammiequon
2017/04/08 01:31:48
Oh wow, i knew that I would spell that wrong so I
| |
| 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 // with D-Bus failure if there is a D-Bus error along the way; called with |
|
Daniel Erat
2017/04/08 01:13:32
shorten second sentence here too
sammiequon
2017/04/08 01:31:48
Done.
| |
| 111 const dbus::ObjectPath& enroll_session_path) = 0; | 112 // D-Bus success otherwise. |
| 112 | 113 |
|
Daniel Erat
2017/04/08 01:13:32
delete blank line after comment
sammiequon
2017/04/08 01:31:47
Done.
| |
| 113 // Ends the auth session at |auth_session_path|. | 114 virtual void CancelEnrollSession(const dbus::ObjectPath& enroll_session_path, |
| 114 virtual void EndAuthSession(const dbus::ObjectPath& auth_session_path) = 0; | 115 const VoidDBusMethodCallback& callback) = 0; |
| 115 | 116 |
| 116 // Changes the label of the record at |record_path| to |label|. | 117 // Ends the auth session at |auth_session_path|. |callback| is called |
| 118 // asynchronosly with the result. | |
| 119 virtual void EndAuthSession(const dbus::ObjectPath& auth_session_path, | |
| 120 const VoidDBusMethodCallback& callback) = 0; | |
| 121 | |
| 122 // Changes the label of the record at |record_path| to |label|. |callback| is | |
| 123 // called asynchronosly with the result. | |
| 117 virtual void SetRecordLabel(const dbus::ObjectPath& record_path, | 124 virtual void SetRecordLabel(const dbus::ObjectPath& record_path, |
| 118 const std::string& label) = 0; | 125 const std::string& label, |
| 126 const VoidDBusMethodCallback& callback) = 0; | |
| 119 | 127 |
| 120 // Removes the record at |record_path|. This record will no longer be able to | 128 // Removes the record at |record_path|. This record will no longer be able to |
| 121 // used for authentication. | 129 // used for authentication. |callback| is asynchronosly with the result. |
|
Daniel Erat
2017/04/08 01:13:32
fix second sentence (missing 'called' after 'is')
sammiequon
2017/04/08 01:31:47
Done.
| |
| 122 virtual void RemoveRecord(const dbus::ObjectPath& record_path) = 0; | 130 virtual void RemoveRecord(const dbus::ObjectPath& record_path, |
| 131 const VoidDBusMethodCallback& callback) = 0; | |
| 123 | 132 |
| 124 // Requests the label of the record at |record_path|. |callback| is called | 133 // Requests the label of the record at |record_path|. |callback| is called |
| 125 // with the label of the record. | 134 // with the label of the record. |
| 126 virtual void RequestRecordLabel(const dbus::ObjectPath& record_path, | 135 virtual void RequestRecordLabel(const dbus::ObjectPath& record_path, |
| 127 const LabelCallback& callback) = 0; | 136 const LabelCallback& callback) = 0; |
| 128 | 137 |
| 129 // Creates the instance. | 138 // Creates the instance. |
| 130 static BiodClient* Create(DBusClientImplementationType type); | 139 static BiodClient* Create(DBusClientImplementationType type); |
| 131 | 140 |
| 132 protected: | 141 protected: |
| 133 friend class BiodClientTest; | 142 friend class BiodClientTest; |
| 134 | 143 |
| 135 // Create() should be used instead. | 144 // Create() should be used instead. |
| 136 BiodClient(); | 145 BiodClient(); |
| 137 | 146 |
| 138 private: | 147 private: |
| 139 DISALLOW_COPY_AND_ASSIGN(BiodClient); | 148 DISALLOW_COPY_AND_ASSIGN(BiodClient); |
| 140 }; | 149 }; |
| 141 | 150 |
| 142 } // namespace chromeos | 151 } // namespace chromeos |
| 143 | 152 |
| 144 #endif // CHROMEOS_DBUS_BIOD_BIOD_CLIENT_H_ | 153 #endif // CHROMEOS_DBUS_BIOD_BIOD_CLIENT_H_ |
| OLD | NEW |