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

Unified Diff: chromeos/dbus/biod/fake_biod_client.h

Issue 2578323004: cros: Fake implementation of DBUS biometrics client. (Closed)
Patch Set: Fixed patch set 5 errors. 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/fake_biod_client.h
diff --git a/chromeos/dbus/biod/fake_biod_client.h b/chromeos/dbus/biod/fake_biod_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..3a801915770b1209bca0a31f03f2a3774b7d9cad
--- /dev/null
+++ b/chromeos/dbus/biod/fake_biod_client.h
@@ -0,0 +1,62 @@
+// 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_FAKE_BIOD_CLIENT_H_
+#define CHROMEOS_DBUS_BIOD_FAKE_BIOD_CLIENT_H_
+
+#include "base/macros.h"
+#include "base/observer_list.h"
+#include "chromeos/chromeos_export.h"
+#include "chromeos/dbus/biod/biod_client.h"
+
+namespace dbus {
+class Bus;
+class ObjectPath;
+} // namespace dbus
+
+namespace chromeos {
+
+// A fake implementation of BiodClient.
+class CHROMEOS_EXPORT FakeBiodClient : public BiodClient {
+ public:
+ FakeBiodClient();
+ ~FakeBiodClient() override;
+
+ void NotifyEnrollScanDoneReceived(biod::ScanResult type_result,
Daniel Erat 2017/04/04 05:53:34 nit: add a comment above these like: // Notifies
sammiequon 2017/04/04 16:07:22 Done.
+ bool is_complete);
+ void NotifyAuthScanDoneReceived(biod::ScanResult type_result,
+ const AuthScanMatches& matches);
+ void NotifySessionFailedReceived();
+
+ // BiodClient:
+ void Init(dbus::Bus* bus) override;
+ void AddObserver(Observer* observer) override;
+ void RemoveObserver(Observer* observer) override;
+ bool HasObserver(const Observer* observer) const override;
+ void StartEnrollSession(const std::string& user_id,
+ const std::string& label,
+ const ObjectPathCallback& callback) override;
+ void GetRecordsForUser(const std::string& user_id,
+ const UserRecordsCallback& callback) override;
+ void DestroyAllRecords() override;
+ void StartAuthSession(const ObjectPathCallback& callback) override;
+ void RequestType(const BiometricTypeCallback& callback) override;
+ void CancelEnrollSession(
+ const dbus::ObjectPath& enroll_session_path) override;
+ void EndAuthSession(const dbus::ObjectPath& auth_session_path) override;
+ void SetRecordLabel(const dbus::ObjectPath& record_path,
+ const std::string& label) override;
+ void RemoveRecord(const dbus::ObjectPath& record_path) override;
+ void RequestRecordLabel(const dbus::ObjectPath& record_path,
+ const LabelCallback& callback) override;
+
+ private:
+ base::ObserverList<Observer> observers_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeBiodClient);
+};
+
+} // namespace chromeos
+
+#endif // CHROMEOS_DBUS_BIOD_FAKE_BIOD_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698