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

Unified Diff: chromeos/dbus/biod_record_client.h

Issue 2581403002: cros: Remaining interfaces for DBUS biometrics client. (Closed)
Patch Set: Remove chromeos.gyp. Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chromeos/dbus/biod_record_client.h
diff --git a/chromeos/dbus/biod_record_client.h b/chromeos/dbus/biod_record_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..fdfd86a74dfe752f9fa1aedd993566d8ceefc1b6
--- /dev/null
+++ b/chromeos/dbus/biod_record_client.h
@@ -0,0 +1,59 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_DBUS_BIOD_RECORD_CLIENT_H_
+#define CHROMEOS_DBUS_BIOD_RECORD_CLIENT_H_
+
+#include <stdint.h>
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "chromeos/chromeos_export.h"
+#include "chromeos/dbus/dbus_client.h"
+#include "chromeos/dbus/dbus_client_implementation_type.h"
+#include "chromeos/dbus/dbus_method_call_status.h"
+
+namespace chromeos {
+
+// BiodRecordClient is used to communicate with a biod record via dbus
+// interface.
+class CHROMEOS_EXPORT BiodRecordClient : public DBusClient {
+ public:
+ ~BiodRecordClient() override;
+
+ using StringCallback = base::Callback<void(const std::string&)>;
+
+ // Changes the label of the record at |record_path| to |label|.
+ virtual void SetLabel(const dbus::ObjectPath& record_path,
+ const std::string& label) = 0;
+
+ // Removes the record at |record_path|. This record will no longer be able to
+ // used for authentication.
+ virtual void Remove(const dbus::ObjectPath& record_path) = 0;
+
+ // Fetches the label of the enrollment at |record_path| and runs the
+ // callback |callback| with the label as an argument.
+ virtual void GetLabel(const dbus::ObjectPath& record_path,
+ const StringCallback& callback) = 0;
+
+ // Same as above but returns the label instead of running a callback
+ // function. This is a BLOCKING CALL.
rkc 2017/03/20 23:47:09 Why is this a blocking call? Also nit: no need for
sammiequon 2017/03/21 00:30:39 This is a version of the previous function in case
+ virtual std::string GetLabelBlocking(const dbus::ObjectPath& record_path) = 0;
+
+ // Creates the instance.
+ static BiodRecordClient* Create(DBusClientImplementationType type);
+
+ protected:
+ friend class BiodBiometricsManagerClientTest;
+
+ // Create() should be used instead.
+ BiodRecordClient();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BiodRecordClient);
+};
+
+} // namespace chromeos
+
+#endif // CHROMEOS_DBUS_BIOD_RECORD_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698