| 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 DEVICE_BLUETOOTH_BLUETOOTH_GATT_CONNECTION_CHROMEOS_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_GATT_CONNECTION_CHROMEOS_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_GATT_CONNECTION_CHROMEOS_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_GATT_CONNECTION_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 // BluetoothGattConnectionChromeOS implements BluetoothGattConnection for the | 24 // BluetoothGattConnectionChromeOS implements BluetoothGattConnection for the |
| 25 // Chrome OS platform. | 25 // Chrome OS platform. |
| 26 class BluetoothGattConnectionChromeOS | 26 class BluetoothGattConnectionChromeOS |
| 27 : public device::BluetoothGattConnection, | 27 : public device::BluetoothGattConnection, |
| 28 public bluez::BluetoothDeviceClient::Observer { | 28 public bluez::BluetoothDeviceClient::Observer { |
| 29 public: | 29 public: |
| 30 explicit BluetoothGattConnectionChromeOS( | 30 explicit BluetoothGattConnectionChromeOS( |
| 31 scoped_refptr<device::BluetoothAdapter> adapter, | 31 scoped_refptr<device::BluetoothAdapter> adapter, |
| 32 const std::string& device_address, | 32 const std::string& device_address, |
| 33 const dbus::ObjectPath& object_path); | 33 const dbus::ObjectPath& object_path, |
| 34 bool in_progress); |
| 34 ~BluetoothGattConnectionChromeOS() override; | 35 ~BluetoothGattConnectionChromeOS() override; |
| 35 | 36 |
| 36 // BluetoothGattConnection overrides. | 37 // BluetoothGattConnection overrides. |
| 37 bool IsConnected() override; | 38 bool IsConnected() override; |
| 38 void Disconnect() override; | 39 void Disconnect() override; |
| 39 | 40 |
| 40 private: | 41 private: |
| 41 // bluez::Bluetooth$1Client::Observer overrides. | 42 // bluez::Bluetooth$1Client::Observer overrides. |
| 42 void DeviceRemoved(const dbus::ObjectPath& object_path) override; | 43 void DeviceRemoved(const dbus::ObjectPath& object_path) override; |
| 43 void DevicePropertyChanged(const dbus::ObjectPath& object_path, | 44 void DevicePropertyChanged(const dbus::ObjectPath& object_path, |
| 44 const std::string& property_name) override; | 45 const std::string& property_name) override; |
| 45 | 46 |
| 46 // True, if the connection is currently active. | 47 // True, if the connection is currently active. |
| 47 bool connected_; | 48 bool connected_; |
| 48 | 49 |
| 49 // D-Bus object path of the underlying device. This is used to filter observer | 50 // D-Bus object path of the underlying device. This is used to filter observer |
| 50 // events. | 51 // events. |
| 51 dbus::ObjectPath object_path_; | 52 dbus::ObjectPath object_path_; |
| 52 | 53 |
| 53 DISALLOW_COPY_AND_ASSIGN(BluetoothGattConnectionChromeOS); | 54 DISALLOW_COPY_AND_ASSIGN(BluetoothGattConnectionChromeOS); |
| 54 }; | 55 }; |
| 55 | 56 |
| 56 } // namespace chromeos | 57 } // namespace chromeos |
| 57 | 58 |
| 58 #endif // DEVICE_BLUETOOTH_BLUETOOTH_GATT_CONNECTION_CHROMEOS_H_ | 59 #endif // DEVICE_BLUETOOTH_BLUETOOTH_GATT_CONNECTION_CHROMEOS_H_ |
| OLD | NEW |