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