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

Unified Diff: device/bluetooth/bluetooth_device_bluez.h

Issue 1415573014: Reland "Add Linux support for the Bluetooth API" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: build fix. Created 5 years, 1 month 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_device_bluez.h
diff --git a/device/bluetooth/bluetooth_device_chromeos.h b/device/bluetooth/bluetooth_device_bluez.h
similarity index 88%
rename from device/bluetooth/bluetooth_device_chromeos.h
rename to device/bluetooth/bluetooth_device_bluez.h
index 544fdafe6c9aab6232289bed46b6b1b50c4238a3..8d93f3082810e402512c696bac50810b45309ee4 100644
--- a/device/bluetooth/bluetooth_device_chromeos.h
+++ b/device/bluetooth/bluetooth_device_bluez.h
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_CHROMEOS_H_
-#define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_CHROMEOS_H_
+#ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_BLUEZ_H_
+#define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_BLUEZ_H_
#include <string>
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
@@ -21,19 +22,19 @@ namespace device {
class BluetoothSocketThread;
} // namespace device
-namespace chromeos {
+namespace bluez {
-class BluetoothAdapterChromeOS;
-class BluetoothPairingChromeOS;
+class BluetoothAdapterBlueZ;
+class BluetoothPairingBlueZ;
-// The BluetoothDeviceChromeOS class implements BluetoothDevice for the
+// The BluetoothDeviceBlueZ class implements BluetoothDevice for the
// Chrome OS platform.
//
// This class is not thread-safe, but is only called from the UI thread.
//
// A socket thread is used to create sockets but posts all callbacks on the UI
// thread.
-class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceChromeOS
+class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceBlueZ
: public device::BluetoothDevice,
public bluez::BluetoothGattServiceClient::Observer {
public:
@@ -55,8 +56,7 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceChromeOS
bool ExpectingPinCode() const override;
bool ExpectingPasskey() const override;
bool ExpectingConfirmation() const override;
- void GetConnectionInfo(
- const ConnectionInfoCallback& callback) override;
+ void GetConnectionInfo(const ConnectionInfoCallback& callback) override;
void Connect(device::BluetoothDevice::PairingDelegate* pairing_delegate,
const base::Closure& callback,
const ConnectErrorCallback& error_callback) override;
@@ -86,7 +86,7 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceChromeOS
// Creates a pairing object with the given delegate |pairing_delegate| and
// establishes it as the pairing context for this device. All pairing-related
// method calls will be forwarded to this object until it is released.
- BluetoothPairingChromeOS* BeginPairing(
+ BluetoothPairingBlueZ* BeginPairing(
BluetoothDevice::PairingDelegate* pairing_delegate);
// Releases the current pairing object, any pairing-related method calls will
@@ -94,13 +94,13 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceChromeOS
void EndPairing();
// Returns the current pairing object or NULL if no pairing is in progress.
- BluetoothPairingChromeOS* GetPairing() const;
+ BluetoothPairingBlueZ* GetPairing() const;
// Returns the object path of the device.
const dbus::ObjectPath& object_path() const { return object_path_; }
// Returns the adapter which owns this device instance.
- BluetoothAdapterChromeOS* adapter() const;
+ BluetoothAdapterBlueZ* adapter() const;
protected:
// BluetoothDevice override
@@ -109,14 +109,14 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceChromeOS
void DisconnectGatt() override;
private:
- friend class BluetoothAdapterChromeOS;
+ friend class BluetoothAdapterBlueZ;
- BluetoothDeviceChromeOS(
- BluetoothAdapterChromeOS* adapter,
+ BluetoothDeviceBlueZ(
+ BluetoothAdapterBlueZ* adapter,
const dbus::ObjectPath& object_path,
scoped_refptr<base::SequencedTaskRunner> ui_task_runner,
scoped_refptr<device::BluetoothSocketThread> socket_thread);
- ~BluetoothDeviceChromeOS() override;
+ ~BluetoothDeviceBlueZ() override;
// bluez::BluetoothGattServiceClient::Observer overrides.
void GattServiceAdded(const dbus::ObjectPath& object_path) override;
@@ -137,8 +137,7 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceChromeOS
void ConnectInternal(bool after_pairing,
const base::Closure& callback,
const ConnectErrorCallback& error_callback);
- void OnConnect(bool after_pairing,
- const base::Closure& callback);
+ void OnConnect(bool after_pairing, const base::Closure& callback);
void OnCreateGattConnection(const GattConnectionCallback& callback);
void OnConnectError(bool after_pairing,
const ConnectErrorCallback& error_callback,
@@ -204,15 +203,15 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceChromeOS
// During pairing this is set to an object that we don't own, but on which
// we can make method calls to request, display or confirm PIN Codes and
// Passkeys. Generally it is the object that owns this one.
- scoped_ptr<BluetoothPairingChromeOS> pairing_;
+ scoped_ptr<BluetoothPairingBlueZ> pairing_;
// Note: This should remain the last member so it'll be destroyed and
// invalidate its weak pointers before any other members are destroyed.
- base::WeakPtrFactory<BluetoothDeviceChromeOS> weak_ptr_factory_;
+ base::WeakPtrFactory<BluetoothDeviceBlueZ> weak_ptr_factory_;
- DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceChromeOS);
+ DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceBlueZ);
};
-} // namespace chromeos
+} // namespace bluez
-#endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_CHROMEOS_H_
+#endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_BLUEZ_H_

Powered by Google App Engine
This is Rietveld 408576698