| 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_DESCRIPTOR_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_ | 6 #define CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
| 13 #include "chromeos/chromeos_export.h" | |
| 14 #include "chromeos/dbus/bluetooth_gatt_descriptor_client.h" | |
| 15 #include "dbus/object_path.h" | 13 #include "dbus/object_path.h" |
| 14 #include "device/bluetooth/bluetooth_export.h" |
| 15 #include "device/bluetooth/dbus/bluetooth_gatt_descriptor_client.h" |
| 16 | 16 |
| 17 namespace chromeos { | 17 namespace bluez { |
| 18 | 18 |
| 19 // FakeBluetoothGattDescriptorClient simulates the behavior of the Bluetooth | 19 // FakeBluetoothGattDescriptorClient simulates the behavior of the Bluetooth |
| 20 // Daemon GATT characteristic descriptor objects and is used in test cases in | 20 // Daemon GATT characteristic descriptor objects and is used in test cases in |
| 21 // place of a mock and on the Linux desktop. | 21 // place of a mock and on the Linux desktop. |
| 22 class CHROMEOS_EXPORT FakeBluetoothGattDescriptorClient | 22 class DEVICE_BLUETOOTH_EXPORT FakeBluetoothGattDescriptorClient |
| 23 : public BluetoothGattDescriptorClient { | 23 : public BluetoothGattDescriptorClient { |
| 24 public: | 24 public: |
| 25 struct Properties : public BluetoothGattDescriptorClient::Properties { | 25 struct Properties : public BluetoothGattDescriptorClient::Properties { |
| 26 explicit Properties(const PropertyChangedCallback& callback); | 26 explicit Properties(const PropertyChangedCallback& callback); |
| 27 ~Properties() override; | 27 ~Properties() override; |
| 28 | 28 |
| 29 // dbus::PropertySet override | 29 // dbus::PropertySet override |
| 30 void Get(dbus::PropertyBase* property, | 30 void Get(dbus::PropertyBase* property, |
| 31 dbus::PropertySet::GetCallback callback) override; | 31 dbus::PropertySet::GetCallback callback) override; |
| 32 void GetAll() override; | 32 void GetAll() override; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 typedef std::map<dbus::ObjectPath, DescriptorData*> PropertiesMap; | 86 typedef std::map<dbus::ObjectPath, DescriptorData*> PropertiesMap; |
| 87 PropertiesMap properties_; | 87 PropertiesMap properties_; |
| 88 | 88 |
| 89 // List of observers interested in event notifications from us. | 89 // List of observers interested in event notifications from us. |
| 90 base::ObserverList<Observer> observers_; | 90 base::ObserverList<Observer> observers_; |
| 91 | 91 |
| 92 // Weak pointer factory for generating 'this' pointers that might live longer | 92 // Weak pointer factory for generating 'this' pointers that might live longer |
| 93 // than we do. | 93 // than we do. |
| 94 // Note: This should remain the last member so it'll be destroyed and | 94 // Note: This should remain the last member so it'll be destroyed and |
| 95 // invalidate its weak pointers before any other members are destroyed. | 95 // invalidate its weak pointers before any other members are destroyed. |
| 96 base::WeakPtrFactory<FakeBluetoothGattDescriptorClient> | 96 base::WeakPtrFactory<FakeBluetoothGattDescriptorClient> weak_ptr_factory_; |
| 97 weak_ptr_factory_; | |
| 98 | 97 |
| 99 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothGattDescriptorClient); | 98 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothGattDescriptorClient); |
| 100 }; | 99 }; |
| 101 | 100 |
| 102 } // namespace chromeos | 101 } // namespace bluez |
| 103 | 102 |
| 104 #endif // CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_ | 103 #endif // CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_ |
| OLD | NEW |