| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "services/device/fingerprint/fingerprint_chromeos.h" | 5 #include "services/device/fingerprint/fingerprint_chromeos.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "chromeos/dbus/dbus_thread_manager.h" | 9 #include "chromeos/dbus/dbus_thread_manager.h" |
| 10 #include "mojo/public/cpp/bindings/strong_binding.h" | 10 #include "mojo/public/cpp/bindings/strong_binding.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 } | 175 } |
| 176 | 176 |
| 177 void FingerprintChromeOS::BiodServiceRestarted() { | 177 void FingerprintChromeOS::BiodServiceRestarted() { |
| 178 opened_session_ = FingerprintSession::NONE; | 178 opened_session_ = FingerprintSession::NONE; |
| 179 for (auto& observer : observers_) | 179 for (auto& observer : observers_) |
| 180 observer->OnRestarted(); | 180 observer->OnRestarted(); |
| 181 } | 181 } |
| 182 | 182 |
| 183 void FingerprintChromeOS::BiodEnrollScanDoneReceived( | 183 void FingerprintChromeOS::BiodEnrollScanDoneReceived( |
| 184 biod::ScanResult scan_result, | 184 biod::ScanResult scan_result, |
| 185 bool enroll_session_complete) { | 185 bool enroll_session_complete, |
| 186 int32_t percent_complete) { |
| 186 if (enroll_session_complete) | 187 if (enroll_session_complete) |
| 187 opened_session_ = FingerprintSession::NONE; | 188 opened_session_ = FingerprintSession::NONE; |
| 188 | 189 |
| 189 for (auto& observer : observers_) | 190 for (auto& observer : observers_) |
| 190 observer->OnEnrollScanDone(scan_result, enroll_session_complete); | 191 observer->OnEnrollScanDone(scan_result, enroll_session_complete, |
| 192 percent_complete); |
| 191 } | 193 } |
| 192 | 194 |
| 193 void FingerprintChromeOS::BiodAuthScanDoneReceived( | 195 void FingerprintChromeOS::BiodAuthScanDoneReceived( |
| 194 biod::ScanResult scan_result, | 196 biod::ScanResult scan_result, |
| 195 const chromeos::AuthScanMatches& matches) { | 197 const chromeos::AuthScanMatches& matches) { |
| 196 // Convert ObjectPath to string, since mojom doesn't know definition of | 198 // Convert ObjectPath to string, since mojom doesn't know definition of |
| 197 // dbus ObjectPath. | 199 // dbus ObjectPath. |
| 198 std::unordered_map<std::string, std::vector<std::string>> result; | 200 std::unordered_map<std::string, std::vector<std::string>> result; |
| 199 for (auto& item : matches) { | 201 for (auto& item : matches) { |
| 200 std::vector<std::string> paths; | 202 std::vector<std::string> paths; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 callback.Run(records_path_to_label_); | 266 callback.Run(records_path_to_label_); |
| 265 } | 267 } |
| 266 | 268 |
| 267 // static | 269 // static |
| 268 void Fingerprint::Create(device::mojom::FingerprintRequest request) { | 270 void Fingerprint::Create(device::mojom::FingerprintRequest request) { |
| 269 mojo::MakeStrongBinding(base::MakeUnique<FingerprintChromeOS>(), | 271 mojo::MakeStrongBinding(base::MakeUnique<FingerprintChromeOS>(), |
| 270 std::move(request)); | 272 std::move(request)); |
| 271 } | 273 } |
| 272 | 274 |
| 273 } // namespace device | 275 } // namespace device |
| OLD | NEW |