Index: device/fingerprint/fingerprint_impl.cc |
diff --git a/device/fingerprint/fingerprint_impl.cc b/device/fingerprint/fingerprint_impl.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0059877e024c87f4ad65760fbb2caad66d913a65 |
--- /dev/null |
+++ b/device/fingerprint/fingerprint_impl.cc |
@@ -0,0 +1,101 @@ |
+// Copyright 2016 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. |
+ |
+#include "device/fingerprint/fingerprint_impl.h" |
+ |
+#include <string.h> |
+ |
+#include "mojo/public/cpp/bindings/strong_binding.h" |
+ |
+namespace device { |
+ |
+FingerprintImpl::FingerprintImpl() : weak_ptr_factory_(this) {} |
+ |
+FingerprintImpl::~FingerprintImpl() {} |
+ |
+// static |
+void FingerprintImpl::Create(device::mojom::FingerprintRequest request) { |
+ mojo::MakeStrongBinding(base::MakeUnique<FingerprintImpl>(), |
+ std::move(request)); |
+} |
+ |
+void FingerprintImpl::GetFingerprintsList( |
+ const GetFingerprintsListCallback& callback) {} |
+ |
+void FingerprintImpl::StartEnroll(const std::string& user_id, |
+ const std::string& label) {} |
+ |
+void FingerprintImpl::CancelCurrentEnroll() { |
+ // Call Dbus to canel current enroll and reset the current_enroll_path. |
+ current_enroll_path_.reset(); |
+} |
+ |
+void FingerprintImpl::GetLabel(int32_t index, |
+ const GetLabelCallback& callback) {} |
+ |
+void FingerprintImpl::SetLabel(const std::string& label, int32_t index) {} |
+ |
+void FingerprintImpl::RemoveEnrollment(int32_t index) {} |
+ |
+void FingerprintImpl::StartAuthentication() {} |
+ |
+void FingerprintImpl::EndCurrentAuthentication() { |
+ // Call Dbus to canel current authentication and reset the current_auth_path. |
+ current_auth_path_.reset(); |
+} |
+ |
+void FingerprintImpl::DestroyAllEnrollments() {} |
+ |
+void FingerprintImpl::AddBiodObserver(mojom::BiodObserverPtr observer) { |
+ observer.set_connection_error_handler( |
+ base::Bind(&FingerprintImpl::OnBiodObserverDisconnected, |
+ base::Unretained(this), observer.get())); |
+ observers_.push_back(std::move(observer)); |
+} |
+ |
+void FingerprintImpl::OnBiodObserverDisconnected( |
+ mojom::BiodObserver* observer) { |
+ for (auto item = observers_.begin(); item != observers_.end(); ++item) { |
+ if (item->get() == observer) { |
+ observers_.erase(item); |
+ break; |
+ } |
+ } |
+} |
+ |
+void FingerprintImpl::OnStartEnroll(const dbus::ObjectPath& enroll_path) { |
+ DCHECK(!current_enroll_path_); |
+ current_enroll_path_ = base::MakeUnique<dbus::ObjectPath>(enroll_path); |
+} |
+ |
+void FingerprintImpl::OnStartAuthentication(const dbus::ObjectPath& auth_path) { |
+ DCHECK(!current_auth_path_); |
+ current_auth_path_ = base::MakeUnique<dbus::ObjectPath>(auth_path); |
+} |
+ |
+void FingerprintImpl::OnGetFingerprintsList( |
+ const GetFingerprintsListCallback& callback, |
+ const std::vector<dbus::ObjectPath>& enrollment_paths) {} |
+ |
+void FingerprintImpl::OnGetLabel( |
+ int32_t index, |
+ const GetLabelCallback& callback, |
+ const std::vector<dbus::ObjectPath>& enrollment_paths) { |
+ DCHECK(index >= 0 && index < int{enrollment_paths.size()}); |
+} |
+ |
+void FingerprintImpl::OnSetLabel( |
+ const std::string& new_label, |
+ int index, |
+ const std::vector<dbus::ObjectPath>& enrollment_paths) { |
+ DCHECK(index >= 0 && index < int{enrollment_paths.size()}); |
+} |
+ |
+void FingerprintImpl::OnRemoveEnrollment( |
+ int index, |
+ const std::vector<dbus::ObjectPath>& enrollment_paths) { |
+ DCHECK(index >= 0 && index < int{enrollment_paths.size()}); |
+} |
+ |
+} // namespace device |