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

Unified Diff: device/bluetooth/bluetooth_gatt_connection_chromeos.h

Issue 333983003: device/bluetooth: Implement BluetoothGattConnection on Chrome OS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/bluetooth_gatt_connection_chromeos.h
diff --git a/device/bluetooth/bluetooth_gatt_connection_chromeos.h b/device/bluetooth/bluetooth_gatt_connection_chromeos.h
new file mode 100644
index 0000000000000000000000000000000000000000..beade19d17bf76088d99a6d5046a5132e8e30703
--- /dev/null
+++ b/device/bluetooth/bluetooth_gatt_connection_chromeos.h
@@ -0,0 +1,66 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef DEVICE_BLUETOOTH_BLUETOOTH_GATT_CONNECTION_CHROMEOS_H_
+#define DEVICE_BLUETOOTH_BLUETOOTH_GATT_CONNECTION_CHROMEOS_H_
+
+#include <string>
+
+#include "base/callback.h"
+#include "base/memory/weak_ptr.h"
+#include "chromeos/dbus/bluetooth_device_client.h"
+#include "dbus/object_path.h"
+#include "device/bluetooth/bluetooth_gatt_connection.h"
+
+namespace device {
+
+class BluetoothAdapter;
+
+} // namespace device
+
+namespace chromeos {
+
+// BluetoothGattConnectionChromeOS implements BluetoothGattConnection for the
+// Chrome OS platform.
+class BluetoothGattConnectionChromeOS
+ : public device::BluetoothGattConnection,
+ public BluetoothDeviceClient::Observer {
+ public:
+ explicit BluetoothGattConnectionChromeOS(
+ scoped_refptr<device::BluetoothAdapter> adapter,
+ const std::string& device_address,
+ const dbus::ObjectPath& object_path);
+ virtual ~BluetoothGattConnectionChromeOS();
+
+ // BluetoothGattConnection overrides.
+ virtual std::string GetDeviceAddress() const OVERRIDE;
+ virtual bool IsConnected() OVERRIDE;
+ virtual void Disconnect(const base::Closure& callback) OVERRIDE;
+
+ private:
+
+ // chromeos::BluetoothDeviceClient::Observer overrides.
+ virtual void DeviceRemoved(const dbus::ObjectPath& object_path) OVERRIDE;
+ virtual void DevicePropertyChanged(const dbus::ObjectPath& object_path,
+ const std::string& property_name) OVERRIDE;
+
+ // True, if the connection is currently active.
+ bool connected_;
+
+ // The Bluetooth adapter that this connection is associated with.
+ scoped_refptr<device::BluetoothAdapter> adapter_;
+
+ // Bluetooth address of the underlying device.
+ std::string device_address_;
+
+ // D-Bus object path of the underlying device. This is used to filter observer
+ // events.
+ dbus::ObjectPath object_path_;
+
+ DISALLOW_COPY_AND_ASSIGN(BluetoothGattConnectionChromeOS);
+};
+
+} // namespace chromeos
+
+#endif // DEVICE_BLUETOOTH_BLUETOOTH_GATT_CONNECTION_CHROMEOS_H_
« 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