Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 SERVICES_DEVICE_FINGERPRINT_FINGERPRINT_IMPL_CHROMEOS_H_ | |
| 6 #define SERVICES_DEVICE_FINGERPRINT_FINGERPRINT_IMPL_CHROMEOS_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "dbus/object_path.h" | |
|
stevenjb
2017/02/22 16:32:21
You should be able to forward declare ObjectPath a
xiaoyinh(OOO Sep 11-29)
2017/02/22 21:03:17
Done.
| |
| 12 #include "services/device/public/interfaces/fingerprint.mojom.h" | |
| 13 | |
| 14 namespace device { | |
| 15 | |
| 16 // Implementation of Fingerprint interface for ChromeOS platform. | |
| 17 // This is used to connect to biod(through dbus) and perform fingerprint related | |
| 18 // operations. It will also observe signals from biod. | |
|
blundell
2017/02/22 15:20:06
nit: s/will also observe/observes
xiaoyinh(OOO Sep 11-29)
2017/02/22 21:03:17
Done.
| |
| 19 class FingerprintImplChromeOS : public mojom::Fingerprint { | |
| 20 public: | |
| 21 explicit FingerprintImplChromeOS(); | |
| 22 ~FingerprintImplChromeOS() override; | |
| 23 | |
| 24 // mojom::Fingerprint: | |
| 25 void GetFingerprintsList( | |
| 26 const GetFingerprintsListCallback& callback) override; | |
| 27 void StartEnroll(const std::string& user_id, | |
| 28 const std::string& label) override; | |
| 29 void CancelCurrentEnroll() override; | |
| 30 void GetLabel(int32_t index, const GetLabelCallback& callback) override; | |
| 31 void SetLabel(const std::string& label, int32_t index) override; | |
| 32 void RemoveEnrollment(int32_t index) override; | |
| 33 void StartAuthentication() override; | |
| 34 void EndCurrentAuthentication() override; | |
| 35 void DestroyAllEnrollments() override; | |
| 36 void AddBiodObserver(mojom::BiodObserverPtr observer) override; | |
| 37 | |
| 38 private: | |
| 39 friend class FingerprintImplChromeOSTest; | |
| 40 | |
| 41 void BiodBiometricClientRestarted(); | |
| 42 void BiometricsScanEventReceived(uint32_t scan_result, bool is_complete); | |
| 43 void BiometricsAttemptEventReceived( | |
| 44 uint32_t scan_result, | |
| 45 const std::vector<std::string>& recognized_user_ids); | |
| 46 void BiometricsFailureReceived(); | |
| 47 | |
| 48 void OnBiodObserverDisconnected(mojom::BiodObserver* observer); | |
| 49 void OnStartEnroll(const dbus::ObjectPath& enroll_path); | |
| 50 void OnStartAuthentication(const dbus::ObjectPath& auth_path); | |
| 51 void OnGetFingerprintsList( | |
| 52 const GetFingerprintsListCallback& callback, | |
| 53 const std::vector<dbus::ObjectPath>& enrollment_paths); | |
| 54 void OnGetLabelFromEnrollmentPath(const GetFingerprintsListCallback& callback, | |
| 55 size_t num_enrollments, | |
| 56 std::vector<std::string>* out_labels, | |
| 57 const std::string& label); | |
| 58 | |
| 59 void OnGetLabel(int32_t index, | |
| 60 const GetLabelCallback& callback, | |
| 61 const std::vector<dbus::ObjectPath>& enrollment_paths); | |
| 62 void OnSetLabel(const std::string& new_label, | |
| 63 int index, | |
| 64 const std::vector<dbus::ObjectPath>& enrollment_paths); | |
| 65 void OnRemoveEnrollment( | |
| 66 int index, | |
| 67 const std::vector<dbus::ObjectPath>& enrollment_paths); | |
| 68 | |
| 69 std::vector<mojom::BiodObserverPtr> observers_; | |
| 70 std::unique_ptr<dbus::ObjectPath> current_enroll_path_; | |
| 71 std::unique_ptr<dbus::ObjectPath> current_auth_path_; | |
| 72 | |
| 73 base::WeakPtrFactory<FingerprintImplChromeOS> weak_ptr_factory_; | |
| 74 | |
| 75 DISALLOW_COPY_AND_ASSIGN(FingerprintImplChromeOS); | |
| 76 }; | |
| 77 | |
| 78 } // namespace device | |
| 79 | |
| 80 #endif // SERVICES_DEVICE_FINGERPRINT_FINGERPRINT_IMPL_CHROMEOS_H_ | |
| OLD | NEW |