| 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 "chromeos/dbus/biod/fake_biod_client.h" | 5 #include "chromeos/dbus/biod/fake_biod_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
| 9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
| 10 #include "dbus/object_path.h" | 10 #include "dbus/object_path.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 base::ThreadTaskRunnerHandle::Get()->PostTask( | 53 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 54 FROM_HERE, base::Bind(callback, dbus::ObjectPath())); | 54 FROM_HERE, base::Bind(callback, dbus::ObjectPath())); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void FakeBiodClient::GetRecordsForUser(const std::string& /* user_id */, | 57 void FakeBiodClient::GetRecordsForUser(const std::string& /* user_id */, |
| 58 const UserRecordsCallback& callback) { | 58 const UserRecordsCallback& callback) { |
| 59 base::ThreadTaskRunnerHandle::Get()->PostTask( | 59 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 60 FROM_HERE, base::Bind(callback, std::vector<dbus::ObjectPath>())); | 60 FROM_HERE, base::Bind(callback, std::vector<dbus::ObjectPath>())); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void FakeBiodClient::DestroyAllRecords() {} | 63 void FakeBiodClient::DestroyAllRecords(const VoidDBusMethodCallback& callback) { |
| 64 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 65 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS)); |
| 66 } |
| 64 | 67 |
| 65 void FakeBiodClient::StartAuthSession(const ObjectPathCallback& callback) { | 68 void FakeBiodClient::StartAuthSession(const ObjectPathCallback& callback) { |
| 66 base::ThreadTaskRunnerHandle::Get()->PostTask( | 69 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 67 FROM_HERE, base::Bind(callback, dbus::ObjectPath())); | 70 FROM_HERE, base::Bind(callback, dbus::ObjectPath())); |
| 68 } | 71 } |
| 69 | 72 |
| 70 void FakeBiodClient::RequestType(const BiometricTypeCallback& callback) { | 73 void FakeBiodClient::RequestType(const BiometricTypeCallback& callback) { |
| 71 base::ThreadTaskRunnerHandle::Get()->PostTask( | 74 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 72 FROM_HERE, | 75 FROM_HERE, |
| 73 base::Bind(callback, biod::BiometricType::BIOMETRIC_TYPE_UNKNOWN)); | 76 base::Bind(callback, biod::BiometricType::BIOMETRIC_TYPE_UNKNOWN)); |
| 74 } | 77 } |
| 75 | 78 |
| 76 void FakeBiodClient::CancelEnrollSession( | 79 void FakeBiodClient::CancelEnrollSession( |
| 77 const dbus::ObjectPath& /* enroll_session_path */) {} | 80 const dbus::ObjectPath& /* enroll_session_path */, |
| 81 const VoidDBusMethodCallback& callback) { |
| 82 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 83 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS)); |
| 84 } |
| 78 | 85 |
| 79 void FakeBiodClient::EndAuthSession( | 86 void FakeBiodClient::EndAuthSession( |
| 80 const dbus::ObjectPath& /* auth_session_path */) {} | 87 const dbus::ObjectPath& /* auth_session_path */, |
| 88 const VoidDBusMethodCallback& callback) { |
| 89 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 90 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS)); |
| 91 } |
| 81 | 92 |
| 82 void FakeBiodClient::SetRecordLabel(const dbus::ObjectPath& /* record_path */, | 93 void FakeBiodClient::SetRecordLabel(const dbus::ObjectPath& /* record_path */, |
| 83 const std::string& /* label */) {} | 94 const std::string& /* label */, |
| 95 const VoidDBusMethodCallback& callback) { |
| 96 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 97 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS)); |
| 98 } |
| 84 | 99 |
| 85 void FakeBiodClient::RemoveRecord(const dbus::ObjectPath& /* record_path */) {} | 100 void FakeBiodClient::RemoveRecord(const dbus::ObjectPath& /* record_path */, |
| 101 const VoidDBusMethodCallback& callback) { |
| 102 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 103 FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS)); |
| 104 } |
| 86 | 105 |
| 87 void FakeBiodClient::RequestRecordLabel( | 106 void FakeBiodClient::RequestRecordLabel( |
| 88 const dbus::ObjectPath& /* record_path */, | 107 const dbus::ObjectPath& /* record_path */, |
| 89 const LabelCallback& callback) { | 108 const LabelCallback& callback) { |
| 90 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, | 109 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, |
| 91 base::Bind(callback, "")); | 110 base::Bind(callback, "")); |
| 92 } | 111 } |
| 93 | 112 |
| 94 } // namespace chromeos | 113 } // namespace chromeos |
| OLD | NEW |