Chromium Code Reviews| Index: services/device/fingerprint/fingerprint_impl_chromeos.h | 
| diff --git a/services/device/fingerprint/fingerprint_impl_chromeos.h b/services/device/fingerprint/fingerprint_impl_chromeos.h | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..b092d6f648d9c8120ddc586c121fbc8cf5f71f45 | 
| --- /dev/null | 
| +++ b/services/device/fingerprint/fingerprint_impl_chromeos.h | 
| @@ -0,0 +1,80 @@ | 
| +// 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 SERVICES_DEVICE_FINGERPRINT_FINGERPRINT_IMPL_CHROMEOS_H_ | 
| +#define SERVICES_DEVICE_FINGERPRINT_FINGERPRINT_IMPL_CHROMEOS_H_ | 
| + | 
| +#include <stdint.h> | 
| + | 
| +#include "base/macros.h" | 
| +#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.
 
 | 
| +#include "services/device/public/interfaces/fingerprint.mojom.h" | 
| + | 
| +namespace device { | 
| + | 
| +// Implementation of Fingerprint interface for ChromeOS platform. | 
| +// This is used to connect to biod(through dbus) and perform fingerprint related | 
| +// 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.
 
 | 
| +class FingerprintImplChromeOS : public mojom::Fingerprint { | 
| + public: | 
| + explicit FingerprintImplChromeOS(); | 
| + ~FingerprintImplChromeOS() override; | 
| + | 
| + // mojom::Fingerprint: | 
| + void GetFingerprintsList( | 
| + const GetFingerprintsListCallback& callback) override; | 
| + void StartEnroll(const std::string& user_id, | 
| + const std::string& label) override; | 
| + void CancelCurrentEnroll() override; | 
| + void GetLabel(int32_t index, const GetLabelCallback& callback) override; | 
| + void SetLabel(const std::string& label, int32_t index) override; | 
| + void RemoveEnrollment(int32_t index) override; | 
| + void StartAuthentication() override; | 
| + void EndCurrentAuthentication() override; | 
| + void DestroyAllEnrollments() override; | 
| + void AddBiodObserver(mojom::BiodObserverPtr observer) override; | 
| + | 
| + private: | 
| + friend class FingerprintImplChromeOSTest; | 
| + | 
| + void BiodBiometricClientRestarted(); | 
| + void BiometricsScanEventReceived(uint32_t scan_result, bool is_complete); | 
| + void BiometricsAttemptEventReceived( | 
| + uint32_t scan_result, | 
| + const std::vector<std::string>& recognized_user_ids); | 
| + void BiometricsFailureReceived(); | 
| + | 
| + void OnBiodObserverDisconnected(mojom::BiodObserver* observer); | 
| + void OnStartEnroll(const dbus::ObjectPath& enroll_path); | 
| + void OnStartAuthentication(const dbus::ObjectPath& auth_path); | 
| + void OnGetFingerprintsList( | 
| + const GetFingerprintsListCallback& callback, | 
| + const std::vector<dbus::ObjectPath>& enrollment_paths); | 
| + void OnGetLabelFromEnrollmentPath(const GetFingerprintsListCallback& callback, | 
| + size_t num_enrollments, | 
| + std::vector<std::string>* out_labels, | 
| + const std::string& label); | 
| + | 
| + void OnGetLabel(int32_t index, | 
| + const GetLabelCallback& callback, | 
| + const std::vector<dbus::ObjectPath>& enrollment_paths); | 
| + void OnSetLabel(const std::string& new_label, | 
| + int index, | 
| + const std::vector<dbus::ObjectPath>& enrollment_paths); | 
| + void OnRemoveEnrollment( | 
| + int index, | 
| + const std::vector<dbus::ObjectPath>& enrollment_paths); | 
| + | 
| + std::vector<mojom::BiodObserverPtr> observers_; | 
| + std::unique_ptr<dbus::ObjectPath> current_enroll_path_; | 
| + std::unique_ptr<dbus::ObjectPath> current_auth_path_; | 
| + | 
| + base::WeakPtrFactory<FingerprintImplChromeOS> weak_ptr_factory_; | 
| + | 
| + DISALLOW_COPY_AND_ASSIGN(FingerprintImplChromeOS); | 
| +}; | 
| + | 
| +} // namespace device | 
| + | 
| +#endif // SERVICES_DEVICE_FINGERPRINT_FINGERPRINT_IMPL_CHROMEOS_H_ |