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 #include "chromeos/dbus/fake_biod_biometrics_manager_client.h" |
| 6 |
| 7 #include <stdint.h> |
| 8 |
| 9 #include "base/bind.h" |
| 10 #include "base/macros.h" |
| 11 #include "base/memory/ptr_util.h" |
| 12 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 13 |
| 14 namespace chromeos { |
| 15 |
| 16 FakeBiodBiometricsManagerClient::FakeBiodBiometricsManagerClient() |
| 17 : weak_ptr_factory_(this) {} |
| 18 |
| 19 FakeBiodBiometricsManagerClient::~FakeBiodBiometricsManagerClient() {} |
| 20 |
| 21 void FakeBiodBiometricsManagerClient::Init(dbus::Bus* bus) {} |
| 22 |
| 23 void FakeBiodBiometricsManagerClient::AddObserver(Observer* observer) { |
| 24 observers_.AddObserver(observer); |
| 25 } |
| 26 |
| 27 void FakeBiodBiometricsManagerClient::RemoveObserver(Observer* observer) { |
| 28 observers_.RemoveObserver(observer); |
| 29 } |
| 30 |
| 31 bool FakeBiodBiometricsManagerClient::HasObserver( |
| 32 const Observer* observer) const { |
| 33 return observers_.HasObserver(observer); |
| 34 } |
| 35 |
| 36 void FakeBiodBiometricsManagerClient::StartEnrollSession( |
| 37 const std::string& user_id, |
| 38 const std::string& label, |
| 39 const ObjectPathCallback& callback) {} |
| 40 |
| 41 void FakeBiodBiometricsManagerClient::GetRecordsForUser( |
| 42 const std::string& user_id, |
| 43 const ObjectPathArrayCallback& callback) {} |
| 44 |
| 45 void FakeBiodBiometricsManagerClient::DestroyAllRecords() {} |
| 46 |
| 47 void FakeBiodBiometricsManagerClient::StartAuthSession( |
| 48 const ObjectPathCallback& callback) {} |
| 49 |
| 50 void FakeBiodBiometricsManagerClient::GetType( |
| 51 const BiometricTypeCallback& callback) {} |
| 52 |
| 53 biod::BiometricType FakeBiodBiometricsManagerClient::GetTypeBlocking() { |
| 54 return biod::BiometricType::BIOMETRIC_FINGERPRINT; |
| 55 } |
| 56 |
| 57 void FakeBiodBiometricsManagerClient::OnEnrollScanDoneReceived( |
| 58 uint32_t type_result, |
| 59 bool is_complete) { |
| 60 for (auto& observer : observers_) |
| 61 observer.EnrollScanDoneReceived(type_result, is_complete); |
| 62 } |
| 63 |
| 64 void FakeBiodBiometricsManagerClient::OnAuthScanDoneReceived( |
| 65 uint32_t type_result, |
| 66 const AuthScanMatches& matches) { |
| 67 for (auto& observer : observers_) |
| 68 observer.AuthScanDoneReceived(type_result, matches); |
| 69 } |
| 70 |
| 71 void FakeBiodBiometricsManagerClient::OnScanFailedReceived() { |
| 72 for (auto& observer : observers_) |
| 73 observer.ScanFailedReceived(); |
| 74 } |
| 75 |
| 76 } // namespace chromeos |
OLD | NEW |