| 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_SERVICE_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_SERVICE_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_SERVICE_CLIENT_H_ | 6 #define CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_SERVICE_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // Linux desktop. | 23 // Linux desktop. |
| 24 class CHROMEOS_EXPORT FakeBluetoothGattServiceClient | 24 class CHROMEOS_EXPORT FakeBluetoothGattServiceClient |
| 25 : public BluetoothGattServiceClient { | 25 : public BluetoothGattServiceClient { |
| 26 public: | 26 public: |
| 27 struct Properties : public BluetoothGattServiceClient::Properties { | 27 struct Properties : public BluetoothGattServiceClient::Properties { |
| 28 explicit Properties(const PropertyChangedCallback& callback); | 28 explicit Properties(const PropertyChangedCallback& callback); |
| 29 virtual ~Properties(); | 29 virtual ~Properties(); |
| 30 | 30 |
| 31 // dbus::PropertySet override | 31 // dbus::PropertySet override |
| 32 virtual void Get(dbus::PropertyBase* property, | 32 virtual void Get(dbus::PropertyBase* property, |
| 33 dbus::PropertySet::GetCallback callback) OVERRIDE; | 33 dbus::PropertySet::GetCallback callback) override; |
| 34 virtual void GetAll() OVERRIDE; | 34 virtual void GetAll() override; |
| 35 virtual void Set(dbus::PropertyBase* property, | 35 virtual void Set(dbus::PropertyBase* property, |
| 36 dbus::PropertySet::SetCallback callback) OVERRIDE; | 36 dbus::PropertySet::SetCallback callback) override; |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 FakeBluetoothGattServiceClient(); | 39 FakeBluetoothGattServiceClient(); |
| 40 virtual ~FakeBluetoothGattServiceClient(); | 40 virtual ~FakeBluetoothGattServiceClient(); |
| 41 | 41 |
| 42 // DBusClient override. | 42 // DBusClient override. |
| 43 virtual void Init(dbus::Bus* bus) OVERRIDE; | 43 virtual void Init(dbus::Bus* bus) override; |
| 44 | 44 |
| 45 // BluetoothGattServiceClient overrides. | 45 // BluetoothGattServiceClient overrides. |
| 46 virtual void AddObserver(Observer* observer) OVERRIDE; | 46 virtual void AddObserver(Observer* observer) override; |
| 47 virtual void RemoveObserver(Observer* observer) OVERRIDE; | 47 virtual void RemoveObserver(Observer* observer) override; |
| 48 virtual std::vector<dbus::ObjectPath> GetServices() OVERRIDE; | 48 virtual std::vector<dbus::ObjectPath> GetServices() override; |
| 49 virtual Properties* GetProperties(const dbus::ObjectPath& object_path) | 49 virtual Properties* GetProperties(const dbus::ObjectPath& object_path) |
| 50 OVERRIDE; | 50 override; |
| 51 | 51 |
| 52 // Makes a service visible for device with object path |device_path|. Note | 52 // Makes a service visible for device with object path |device_path|. Note |
| 53 // that only one instance of a specific service is simulated at a time. Hence, | 53 // that only one instance of a specific service is simulated at a time. Hence, |
| 54 // this method will fail, if the service is already visible. | 54 // this method will fail, if the service is already visible. |
| 55 void ExposeHeartRateService(const dbus::ObjectPath& device_path); | 55 void ExposeHeartRateService(const dbus::ObjectPath& device_path); |
| 56 void HideHeartRateService(); | 56 void HideHeartRateService(); |
| 57 | 57 |
| 58 // Returns whether or not the Heart Rate Service is visible. | 58 // Returns whether or not the Heart Rate Service is visible. |
| 59 bool IsHeartRateVisible() const; | 59 bool IsHeartRateVisible() const; |
| 60 | 60 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 // Note: This should remain the last member so it'll be destroyed and | 98 // Note: This should remain the last member so it'll be destroyed and |
| 99 // invalidate its weak pointers before any other members are destroyed. | 99 // invalidate its weak pointers before any other members are destroyed. |
| 100 base::WeakPtrFactory<FakeBluetoothGattServiceClient> weak_ptr_factory_; | 100 base::WeakPtrFactory<FakeBluetoothGattServiceClient> weak_ptr_factory_; |
| 101 | 101 |
| 102 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothGattServiceClient); | 102 DISALLOW_COPY_AND_ASSIGN(FakeBluetoothGattServiceClient); |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 } // namespace chromeos | 105 } // namespace chromeos |
| 106 | 106 |
| 107 #endif // CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_SERVICE_CLIENT_H_ | 107 #endif // CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_SERVICE_CLIENT_H_ |
| OLD | NEW |