OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CHROMEOS_DBUS_FAKE_BLUETOOTH_LE_ADVERTISEMENT_SERVICE_PROVIDER_H_ | 5 #ifndef CHROMEOS_DBUS_FAKE_BLUETOOTH_LE_ADVERTISEMENT_SERVICE_PROVIDER_H_ |
6 #define CHROMEOS_DBUS_FAKE_BLUETOOTH_LE_ADVERTISEMENT_SERVICE_PROVIDER_H_ | 6 #define CHROMEOS_DBUS_FAKE_BLUETOOTH_LE_ADVERTISEMENT_SERVICE_PROVIDER_H_ |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "chromeos/chromeos_export.h" | |
12 #include "chromeos/dbus/bluetooth_le_advertisement_service_provider.h" | |
13 #include "dbus/file_descriptor.h" | 11 #include "dbus/file_descriptor.h" |
14 #include "dbus/object_path.h" | 12 #include "dbus/object_path.h" |
| 13 #include "device/bluetooth/bluetooth_export.h" |
| 14 #include "device/bluetooth/dbus/bluetooth_le_advertisement_service_provider.h" |
15 | 15 |
16 namespace chromeos { | 16 namespace bluez { |
17 | 17 |
18 // FakeBluetoothAdvertisementServiceProvider simulates the behavior of a local | 18 // FakeBluetoothAdvertisementServiceProvider simulates the behavior of a local |
19 // Bluetooth agent object and is used both in test cases in place of a | 19 // Bluetooth agent object and is used both in test cases in place of a |
20 // mock and on the Linux desktop. | 20 // mock and on the Linux desktop. |
21 class CHROMEOS_EXPORT FakeBluetoothLEAdvertisementServiceProvider | 21 class DEVICE_BLUETOOTH_EXPORT FakeBluetoothLEAdvertisementServiceProvider |
22 : public BluetoothLEAdvertisementServiceProvider { | 22 : public BluetoothLEAdvertisementServiceProvider { |
23 public: | 23 public: |
24 FakeBluetoothLEAdvertisementServiceProvider( | 24 FakeBluetoothLEAdvertisementServiceProvider( |
25 const dbus::ObjectPath& object_path, | 25 const dbus::ObjectPath& object_path, |
26 Delegate* delegate); | 26 Delegate* delegate); |
27 ~FakeBluetoothLEAdvertisementServiceProvider() override; | 27 ~FakeBluetoothLEAdvertisementServiceProvider() override; |
28 | 28 |
29 // Each of these calls the equivalent | 29 // Each of these calls the equivalent |
30 // BluetoothAdvertisementServiceProvider::Delegate method on the object passed | 30 // BluetoothAdvertisementServiceProvider::Delegate method on the object passed |
31 // on construction. | 31 // on construction. |
32 void Release(); | 32 void Release(); |
33 | 33 |
34 const dbus::ObjectPath& object_path() { return object_path_; } | 34 const dbus::ObjectPath& object_path() { return object_path_; } |
35 | 35 |
36 private: | 36 private: |
37 friend class FakeBluetoothLEAdvertisingManagerClient; | 37 friend class FakeBluetoothLEAdvertisingManagerClient; |
38 | 38 |
39 // All incoming method calls are passed on to the Delegate and a callback | 39 // All incoming method calls are passed on to the Delegate and a callback |
40 // passed to generate the reply. |delegate_| is generally the object that | 40 // passed to generate the reply. |delegate_| is generally the object that |
41 // owns this one, and must outlive it. | 41 // owns this one, and must outlive it. |
42 Delegate* delegate_; | 42 Delegate* delegate_; |
43 | 43 |
44 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothLEAdvertisementServiceProvider); | 44 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothLEAdvertisementServiceProvider); |
45 }; | 45 }; |
46 | 46 |
47 } // namespace chromeos | 47 } // namespace bluez |
48 | 48 |
49 #endif // CHROMEOS_DBUS_FAKE_BLUETOOTH_LE_ADVERTISEMENT_SERVICE_PROVIDER_H_ | 49 #endif // CHROMEOS_DBUS_FAKE_BLUETOOTH_LE_ADVERTISEMENT_SERVICE_PROVIDER_H_ |
OLD | NEW |