Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(617)

Side by Side Diff: device/bluetooth/bluetooth_gatt_connection_chromeos.h

Issue 1347193004: Refactor DBusThreadManager to split away BT clients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "chromeos/dbus/bluetooth_device_client.h"
13 #include "dbus/object_path.h" 12 #include "dbus/object_path.h"
14 #include "device/bluetooth/bluetooth_gatt_connection.h" 13 #include "device/bluetooth/bluetooth_gatt_connection.h"
14 #include "device/bluetooth/dbus/bluetooth_device_client.h"
15 15
16 namespace device { 16 namespace device {
17 17
18 class BluetoothAdapter; 18 class BluetoothAdapter;
19 19
20 } // namespace device 20 } // namespace device
21 21
22 namespace chromeos { 22 namespace chromeos {
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 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 ~BluetoothGattConnectionChromeOS() override; 34 ~BluetoothGattConnectionChromeOS() override;
35 35
36 // BluetoothGattConnection overrides. 36 // BluetoothGattConnection overrides.
37 bool IsConnected() override; 37 bool IsConnected() override;
38 void Disconnect() override; 38 void Disconnect() override;
39 39
40 private: 40 private:
41 41 // bluez::Bluetooth$1Client::Observer overrides.
42 // chromeos::BluetoothDeviceClient::Observer overrides.
43 void DeviceRemoved(const dbus::ObjectPath& object_path) override; 42 void DeviceRemoved(const dbus::ObjectPath& object_path) override;
44 void DevicePropertyChanged(const dbus::ObjectPath& object_path, 43 void DevicePropertyChanged(const dbus::ObjectPath& object_path,
45 const std::string& property_name) override; 44 const std::string& property_name) override;
46 45
47 // True, if the connection is currently active. 46 // True, if the connection is currently active.
48 bool connected_; 47 bool connected_;
49 48
50 // D-Bus object path of the underlying device. This is used to filter observer 49 // D-Bus object path of the underlying device. This is used to filter observer
51 // events. 50 // events.
52 dbus::ObjectPath object_path_; 51 dbus::ObjectPath object_path_;
53 52
54 DISALLOW_COPY_AND_ASSIGN(BluetoothGattConnectionChromeOS); 53 DISALLOW_COPY_AND_ASSIGN(BluetoothGattConnectionChromeOS);
55 }; 54 };
56 55
57 } // namespace chromeos 56 } // namespace chromeos
58 57
59 #endif // DEVICE_BLUETOOTH_BLUETOOTH_GATT_CONNECTION_CHROMEOS_H_ 58 #endif // DEVICE_BLUETOOTH_BLUETOOTH_GATT_CONNECTION_CHROMEOS_H_
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_gatt_chromeos_unittest.cc ('k') | device/bluetooth/bluetooth_gatt_connection_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698