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/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 virtual void RejectPairing() override; | 59 virtual void RejectPairing() override; |
60 virtual void CancelPairing() override; | 60 virtual void CancelPairing() override; |
61 virtual void Disconnect( | 61 virtual void Disconnect( |
62 const base::Closure& callback, | 62 const base::Closure& callback, |
63 const ErrorCallback& error_callback) override; | 63 const ErrorCallback& error_callback) override; |
64 virtual void Forget(const ErrorCallback& error_callback) override; | 64 virtual void Forget(const ErrorCallback& error_callback) override; |
65 virtual void ConnectToService( | 65 virtual void ConnectToService( |
66 const device::BluetoothUUID& uuid, | 66 const device::BluetoothUUID& uuid, |
67 const ConnectToServiceCallback& callback, | 67 const ConnectToServiceCallback& callback, |
68 const ConnectToServiceErrorCallback& error_callback) override; | 68 const ConnectToServiceErrorCallback& error_callback) override; |
| 69 virtual void ConnectToServiceInsecurely( |
| 70 const device::BluetoothUUID& uuid, |
| 71 const ConnectToServiceCallback& callback, |
| 72 const ConnectToServiceErrorCallback& error_callback) override; |
69 virtual void CreateGattConnection( | 73 virtual void CreateGattConnection( |
70 const GattConnectionCallback& callback, | 74 const GattConnectionCallback& callback, |
71 const ConnectErrorCallback& error_callback) override; | 75 const ConnectErrorCallback& error_callback) override; |
72 virtual void StartConnectionMonitor( | 76 virtual void StartConnectionMonitor( |
73 const base::Closure& callback, | 77 const base::Closure& callback, |
74 const ErrorCallback& error_callback) override; | 78 const ErrorCallback& error_callback) override; |
75 | 79 |
76 // Attempts to initiate an insecure outgoing L2CAP or RFCOMM connection to the | |
77 // advertised service on this device matching |uuid|, performing an SDP lookup | |
78 // if necessary to determine the correct protocol and channel for the | |
79 // connection. Unlike ConnectToService, the outgoing connection will request | |
80 // no bonding rather than general bonding. |callback| will be called on a | |
81 // successful connection with a BluetoothSocket instance that is to be owned | |
82 // by the receiver. |error_callback| will be called on failure with a message | |
83 // indicating the cause. | |
84 void ConnectToServiceInsecurely( | |
85 const device::BluetoothUUID& uuid, | |
86 const ConnectToServiceCallback& callback, | |
87 const ConnectToServiceErrorCallback& error_callback); | |
88 | |
89 // Creates a pairing object with the given delegate |pairing_delegate| and | 80 // Creates a pairing object with the given delegate |pairing_delegate| and |
90 // establishes it as the pairing context for this device. All pairing-related | 81 // establishes it as the pairing context for this device. All pairing-related |
91 // method calls will be forwarded to this object until it is released. | 82 // method calls will be forwarded to this object until it is released. |
92 BluetoothPairingChromeOS* BeginPairing( | 83 BluetoothPairingChromeOS* BeginPairing( |
93 BluetoothDevice::PairingDelegate* pairing_delegate); | 84 BluetoothDevice::PairingDelegate* pairing_delegate); |
94 | 85 |
95 // Releases the current pairing object, any pairing-related method calls will | 86 // Releases the current pairing object, any pairing-related method calls will |
96 // be ignored. | 87 // be ignored. |
97 void EndPairing(); | 88 void EndPairing(); |
98 | 89 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 // Note: This should remain the last member so it'll be destroyed and | 190 // Note: This should remain the last member so it'll be destroyed and |
200 // invalidate its weak pointers before any other members are destroyed. | 191 // invalidate its weak pointers before any other members are destroyed. |
201 base::WeakPtrFactory<BluetoothDeviceChromeOS> weak_ptr_factory_; | 192 base::WeakPtrFactory<BluetoothDeviceChromeOS> weak_ptr_factory_; |
202 | 193 |
203 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceChromeOS); | 194 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceChromeOS); |
204 }; | 195 }; |
205 | 196 |
206 } // namespace chromeos | 197 } // namespace chromeos |
207 | 198 |
208 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_CHROMEOS_H | 199 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_CHROMEOS_H |
OLD | NEW |