OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/fake_bluetooth_adapter_client.h" | 5 #include "chromeos/dbus/fake_bluetooth_adapter_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
11 #include "chromeos/dbus/dbus_thread_manager.h" | 11 #include "chromeos/dbus/dbus_thread_manager.h" |
12 #include "chromeos/dbus/fake_bluetooth_device_client.h" | 12 #include "chromeos/dbus/fake_bluetooth_device_client.h" |
13 #include "dbus/object_path.h" | 13 #include "dbus/object_path.h" |
14 #include "third_party/cros_system_api/dbus/service_constants.h" | 14 #include "third_party/cros_system_api/dbus/service_constants.h" |
15 | 15 |
16 namespace chromeos { | 16 namespace chromeos { |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 // Default interval for delayed tasks. | 20 // Default interval for delayed tasks. |
21 const int kSimulationIntervalMs = 750; | 21 const int kSimulationIntervalMs = 750; |
22 | 22 |
23 } // namespace | 23 } // namespace |
24 | 24 |
25 const char FakeBluetoothAdapterClient::kAdapterPath[] = | 25 const char FakeBluetoothAdapterClient::kAdapterPath[] = |
26 "/fake/hci0"; | 26 "/fake/hci0"; |
27 const char FakeBluetoothAdapterClient::kAdapterName[] = | 27 const char FakeBluetoothAdapterClient::kAdapterName[] = |
28 "Fake Adapter"; | 28 "Fake Adapter"; |
29 const char FakeBluetoothAdapterClient::kAdapterAddress[] = | 29 const char FakeBluetoothAdapterClient::kAdapterAddress[] = |
30 "01:1a:2b:1a:2b:03"; | 30 "01:1A:2B:1A:2B:03"; |
31 | 31 |
32 const char FakeBluetoothAdapterClient::kSecondAdapterPath[] = | 32 const char FakeBluetoothAdapterClient::kSecondAdapterPath[] = |
33 "/fake/hci1"; | 33 "/fake/hci1"; |
34 const char FakeBluetoothAdapterClient::kSecondAdapterName[] = | 34 const char FakeBluetoothAdapterClient::kSecondAdapterName[] = |
35 "Second Fake Adapter"; | 35 "Second Fake Adapter"; |
36 const char FakeBluetoothAdapterClient::kSecondAdapterAddress[] = | 36 const char FakeBluetoothAdapterClient::kSecondAdapterAddress[] = |
37 "00:de:51:10:01:00"; | 37 "00:DE:51:10:01:00"; |
38 | 38 |
39 FakeBluetoothAdapterClient::Properties::Properties( | 39 FakeBluetoothAdapterClient::Properties::Properties( |
40 const PropertyChangedCallback& callback) | 40 const PropertyChangedCallback& callback) |
41 : BluetoothAdapterClient::Properties( | 41 : BluetoothAdapterClient::Properties( |
42 NULL, | 42 NULL, |
43 bluetooth_adapter::kBluetoothAdapterInterface, | 43 bluetooth_adapter::kBluetoothAdapterInterface, |
44 callback) { | 44 callback) { |
45 } | 45 } |
46 | 46 |
47 FakeBluetoothAdapterClient::Properties::~Properties() { | 47 FakeBluetoothAdapterClient::Properties::~Properties() { |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 } | 265 } |
266 | 266 |
267 void FakeBluetoothAdapterClient::PostDelayedTask( | 267 void FakeBluetoothAdapterClient::PostDelayedTask( |
268 const base::Closure& callback) { | 268 const base::Closure& callback) { |
269 base::MessageLoop::current()->PostDelayedTask( | 269 base::MessageLoop::current()->PostDelayedTask( |
270 FROM_HERE, callback, | 270 FROM_HERE, callback, |
271 base::TimeDelta::FromMilliseconds(simulation_interval_ms_)); | 271 base::TimeDelta::FromMilliseconds(simulation_interval_ms_)); |
272 } | 272 } |
273 | 273 |
274 } // namespace chromeos | 274 } // namespace chromeos |
OLD | NEW |