| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_DEVICE_CHROMEOS_H | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_CHROMEOS_H |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_CHROMEOS_H | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_CHROMEOS_H |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 virtual void Disconnect( | 50 virtual void Disconnect( |
| 51 const base::Closure& callback, | 51 const base::Closure& callback, |
| 52 const ErrorCallback& error_callback) OVERRIDE; | 52 const ErrorCallback& error_callback) OVERRIDE; |
| 53 virtual void Forget(const ErrorCallback& error_callback) OVERRIDE; | 53 virtual void Forget(const ErrorCallback& error_callback) OVERRIDE; |
| 54 virtual void ConnectToService( | 54 virtual void ConnectToService( |
| 55 const device::BluetoothUUID& service_uuid, | 55 const device::BluetoothUUID& service_uuid, |
| 56 const SocketCallback& callback) OVERRIDE; | 56 const SocketCallback& callback) OVERRIDE; |
| 57 virtual void ConnectToProfile( | 57 virtual void ConnectToProfile( |
| 58 device::BluetoothProfile* profile, | 58 device::BluetoothProfile* profile, |
| 59 const base::Closure& callback, | 59 const base::Closure& callback, |
| 60 const ConnectToProfileErrorCallback& error_callback) OVERRIDE; | 60 const ErrorCallback& error_callback) OVERRIDE; |
| 61 virtual void SetOutOfBandPairingData( | 61 virtual void SetOutOfBandPairingData( |
| 62 const device::BluetoothOutOfBandPairingData& data, | 62 const device::BluetoothOutOfBandPairingData& data, |
| 63 const base::Closure& callback, | 63 const base::Closure& callback, |
| 64 const ErrorCallback& error_callback) OVERRIDE; | 64 const ErrorCallback& error_callback) OVERRIDE; |
| 65 virtual void ClearOutOfBandPairingData( | 65 virtual void ClearOutOfBandPairingData( |
| 66 const base::Closure& callback, | 66 const base::Closure& callback, |
| 67 const ErrorCallback& error_callback) OVERRIDE; | 67 const ErrorCallback& error_callback) OVERRIDE; |
| 68 | 68 |
| 69 // Creates a pairing object with the given delegate |pairing_delegate| and | 69 // Creates a pairing object with the given delegate |pairing_delegate| and |
| 70 // establishes it as the pairing context for this device. All pairing-related | 70 // establishes it as the pairing context for this device. All pairing-related |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 // there is no matching completion call since this object is deleted in the | 133 // there is no matching completion call since this object is deleted in the |
| 134 // process of unpairing. | 134 // process of unpairing. |
| 135 void OnForgetError(const ErrorCallback& error_callback, | 135 void OnForgetError(const ErrorCallback& error_callback, |
| 136 const std::string& error_name, | 136 const std::string& error_name, |
| 137 const std::string& error_message); | 137 const std::string& error_message); |
| 138 | 138 |
| 139 // Called by dbus:: on completion of the D-Bus method call to | 139 // Called by dbus:: on completion of the D-Bus method call to |
| 140 // connect a peofile. | 140 // connect a peofile. |
| 141 void OnConnectProfile(device::BluetoothProfile* profile, | 141 void OnConnectProfile(device::BluetoothProfile* profile, |
| 142 const base::Closure& callback); | 142 const base::Closure& callback); |
| 143 void OnConnectProfileError( | 143 void OnConnectProfileError(device::BluetoothProfile* profile, |
| 144 device::BluetoothProfile* profile, | 144 const ErrorCallback& error_callback, |
| 145 const ConnectToProfileErrorCallback& error_callback, | 145 const std::string& error_name, |
| 146 const std::string& error_name, | 146 const std::string& error_message); |
| 147 const std::string& error_message); | |
| 148 | 147 |
| 149 // Returns the object path of the device; used by BluetoothAdapterChromeOS | 148 // Returns the object path of the device; used by BluetoothAdapterChromeOS |
| 150 const dbus::ObjectPath& object_path() const { return object_path_; } | 149 const dbus::ObjectPath& object_path() const { return object_path_; } |
| 151 | 150 |
| 152 // The adapter that owns this device instance. | 151 // The adapter that owns this device instance. |
| 153 BluetoothAdapterChromeOS* adapter_; | 152 BluetoothAdapterChromeOS* adapter_; |
| 154 | 153 |
| 155 // The dbus object path of the device object. | 154 // The dbus object path of the device object. |
| 156 dbus::ObjectPath object_path_; | 155 dbus::ObjectPath object_path_; |
| 157 | 156 |
| 158 // Number of ongoing calls to Connect(). | 157 // Number of ongoing calls to Connect(). |
| 159 int num_connecting_calls_; | 158 int num_connecting_calls_; |
| 160 | 159 |
| 161 // During pairing this is set to an object that we don't own, but on which | 160 // During pairing this is set to an object that we don't own, but on which |
| 162 // we can make method calls to request, display or confirm PIN Codes and | 161 // we can make method calls to request, display or confirm PIN Codes and |
| 163 // Passkeys. Generally it is the object that owns this one. | 162 // Passkeys. Generally it is the object that owns this one. |
| 164 scoped_ptr<BluetoothPairingChromeOS> pairing_; | 163 scoped_ptr<BluetoothPairingChromeOS> pairing_; |
| 165 | 164 |
| 166 // Note: This should remain the last member so it'll be destroyed and | 165 // Note: This should remain the last member so it'll be destroyed and |
| 167 // invalidate its weak pointers before any other members are destroyed. | 166 // invalidate its weak pointers before any other members are destroyed. |
| 168 base::WeakPtrFactory<BluetoothDeviceChromeOS> weak_ptr_factory_; | 167 base::WeakPtrFactory<BluetoothDeviceChromeOS> weak_ptr_factory_; |
| 169 | 168 |
| 170 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceChromeOS); | 169 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceChromeOS); |
| 171 }; | 170 }; |
| 172 | 171 |
| 173 } // namespace chromeos | 172 } // namespace chromeos |
| 174 | 173 |
| 175 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_CHROMEOS_H | 174 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_CHROMEOS_H |
| OLD | NEW |