OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_GATT_CHARACTERISTIC_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_CHARACTERISTIC_CLIENT_H_ |
6 #define CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_CHARACTERISTIC_CLIENT_H_ | 6 #define CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_CHARACTERISTIC_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
15 #include "chromeos/chromeos_export.h" | |
16 #include "chromeos/dbus/bluetooth_gatt_characteristic_client.h" | |
17 #include "dbus/object_path.h" | 15 #include "dbus/object_path.h" |
18 #include "dbus/property.h" | 16 #include "dbus/property.h" |
| 17 #include "device/bluetooth/bluetooth_export.h" |
| 18 #include "device/bluetooth/dbus/bluetooth_gatt_characteristic_client.h" |
19 | 19 |
20 namespace chromeos { | 20 namespace bluez { |
21 | 21 |
22 // FakeBluetoothGattCharacteristicClient simulates the behavior of the | 22 // FakeBluetoothGattCharacteristicClient simulates the behavior of the |
23 // Bluetooth Daemon GATT characteristic objects and is used in test cases in | 23 // Bluetooth Daemon GATT characteristic objects and is used in test cases in |
24 // place of a mock and on the Linux desktop. | 24 // place of a mock and on the Linux desktop. |
25 class CHROMEOS_EXPORT FakeBluetoothGattCharacteristicClient | 25 class DEVICE_BLUETOOTH_EXPORT FakeBluetoothGattCharacteristicClient |
26 : public BluetoothGattCharacteristicClient { | 26 : public BluetoothGattCharacteristicClient { |
27 public: | 27 public: |
28 struct Properties : public BluetoothGattCharacteristicClient::Properties { | 28 struct Properties : public BluetoothGattCharacteristicClient::Properties { |
29 explicit Properties(const PropertyChangedCallback& callback); | 29 explicit Properties(const PropertyChangedCallback& callback); |
30 ~Properties() override; | 30 ~Properties() override; |
31 | 31 |
32 // dbus::PropertySet override | 32 // dbus::PropertySet override |
33 void Get(dbus::PropertyBase* property, | 33 void Get(dbus::PropertyBase* property, |
34 dbus::PropertySet::GetCallback callback) override; | 34 dbus::PropertySet::GetCallback callback) override; |
35 void GetAll() override; | 35 void GetAll() override; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 // Map of delayed callbacks. | 177 // Map of delayed callbacks. |
178 std::map<std::string, DelayedCallback*> action_extra_requests_; | 178 std::map<std::string, DelayedCallback*> action_extra_requests_; |
179 | 179 |
180 // List of observers interested in event notifications from us. | 180 // List of observers interested in event notifications from us. |
181 base::ObserverList<Observer> observers_; | 181 base::ObserverList<Observer> observers_; |
182 | 182 |
183 // Weak pointer factory for generating 'this' pointers that might live longer | 183 // Weak pointer factory for generating 'this' pointers that might live longer |
184 // than we do. | 184 // than we do. |
185 // Note: This should remain the last member so it'll be destroyed and | 185 // Note: This should remain the last member so it'll be destroyed and |
186 // invalidate its weak pointers before any other members are destroyed. | 186 // invalidate its weak pointers before any other members are destroyed. |
187 base::WeakPtrFactory<FakeBluetoothGattCharacteristicClient> | 187 base::WeakPtrFactory<FakeBluetoothGattCharacteristicClient> weak_ptr_factory_; |
188 weak_ptr_factory_; | |
189 | 188 |
190 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothGattCharacteristicClient); | 189 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothGattCharacteristicClient); |
191 }; | 190 }; |
192 | 191 |
193 } // namespace chromeos | 192 } // namespace bluez |
194 | 193 |
195 #endif // CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_CHARACTERISTIC_CLIENT_H_ | 194 #endif // CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_CHARACTERISTIC_CLIENT_H_ |
OLD | NEW |