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

Side by Side Diff: chromeos/dbus/fake_biod_biometrics_manager_client.h

Issue 2578323004: cros: Fake implementation of DBUS biometrics client. (Closed)
Patch Set: Rebased to master. 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROMEOS_DBUS_FAKE_BIOD_BIOMETRICS_MANAGER_CLIENT_H_
6 #define CHROMEOS_DBUS_FAKE_BIOD_BIOMETRICS_MANAGER_CLIENT_H_
7
8 #include <stdint.h>
9
10 #include "base/callback.h"
11 #include "base/macros.h"
12 #include "base/observer_list.h"
13 #include "chromeos/chromeos_export.h"
14 #include "chromeos/dbus/biod_biometrics_manager_client.h"
15 #include "dbus/object_path.h"
16
17 namespace chromeos {
18
19 // A fake implementation of BiometricsClient.
20 class CHROMEOS_EXPORT FakeBiodBiometricsManagerClient
21 : public BiodBiometricsManagerClient {
22 public:
23 FakeBiodBiometricsManagerClient();
24 ~FakeBiodBiometricsManagerClient() override;
25
26 // BiodBiometricsManagerClient overrides
27 void Init(dbus::Bus* bus) override;
28 void AddObserver(Observer* observer) override;
29 void RemoveObserver(Observer* observer) override;
30 bool HasObserver(const Observer* observer) const override;
31 void StartEnrollSession(const std::string& user_id,
32 const std::string& label,
33 const ObjectPathCallback& callback) override;
34 void GetRecordsForUser(const std::string& user_id,
35 const ObjectPathArrayCallback& callback) override;
36 void DestroyAllRecords() override;
37 void StartAuthSession(const ObjectPathCallback& callback) override;
38 void GetType(const BiometricTypeCallback& callback) override;
39 biod::BiometricType GetTypeBlocking() override;
40
41 private:
42 void OnEnrollScanDoneReceived(uint32_t type_result, bool is_complete);
43 void OnAuthScanDoneReceived(uint32_t type_result,
44 const AuthScanMatches& matches);
45 void OnScanFailedReceived();
46
47 base::ObserverList<Observer> observers_;
48 // Note: This should remain the last member so it'll be destroyed and
49 // invalidate its weak pointers before any other members are destroyed.
50 base::WeakPtrFactory<FakeBiodBiometricsManagerClient> weak_ptr_factory_;
51
52 DISALLOW_COPY_AND_ASSIGN(FakeBiodBiometricsManagerClient);
53 };
54
55 } // namespace chromeos
56
57 #endif // CHROMEOS_DBUS_FAKE_BIOD_BIOMETRICS_MANAGER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698