| 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_PROFILE_WIN_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_PROFILE_WIN_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_PROFILE_WIN_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_PROFILE_WIN_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" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "device/bluetooth/bluetooth_profile.h" | 12 #include "device/bluetooth/bluetooth_profile.h" |
| 13 #include "device/bluetooth/bluetooth_uuid.h" | 13 #include "device/bluetooth/bluetooth_uuid.h" |
| 14 #include "net/base/net_log.h" | 14 #include "net/base/net_log.h" |
| 15 #include "net/socket/tcp_socket.h" | 15 #include "net/socket/tcp_socket.h" |
| 16 | 16 |
| 17 namespace net { | 17 namespace net { |
| 18 class IPEndPoint; | 18 class IPEndPoint; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace device { | 21 namespace device { |
| 22 | 22 |
| 23 class BluetoothAdapter; | 23 class BluetoothAdapter; |
| 24 class BluetoothAdapterWin; | 24 class BluetoothAdapterWin; |
| 25 class BluetoothDeviceWin; | 25 class BluetoothDeviceWin; |
| 26 class BluetoothSocketThreadWin; | 26 class BluetoothSocketThread; |
| 27 class BluetoothSocketWin; | 27 class BluetoothSocketWin; |
| 28 | 28 |
| 29 class BluetoothProfileWin : public BluetoothProfile { | 29 class BluetoothProfileWin : public BluetoothProfile { |
| 30 public: | 30 public: |
| 31 typedef base::Callback<void(const std::string&)> ErrorCallback; | 31 typedef base::Callback<void(const std::string&)> ErrorCallback; |
| 32 | 32 |
| 33 // BluetoothProfile override. | 33 // BluetoothProfile override. |
| 34 virtual void Unregister() OVERRIDE; | 34 virtual void Unregister() OVERRIDE; |
| 35 virtual void SetConnectionCallback( | 35 virtual void SetConnectionCallback( |
| 36 const ConnectionCallback& callback) OVERRIDE; | 36 const ConnectionCallback& callback) OVERRIDE; |
| 37 | 37 |
| 38 // Called by BluetoothProfile::Register to initialize the profile object | 38 // Called by BluetoothProfile::Register to initialize the profile object |
| 39 // asynchronously. | 39 // asynchronously. |
| 40 void Init(const BluetoothUUID& uuid, | 40 void Init(const BluetoothUUID& uuid, |
| 41 const device::BluetoothProfile::Options& options, | 41 const device::BluetoothProfile::Options& options, |
| 42 const ProfileCallback& callback); | 42 const ProfileCallback& callback); |
| 43 | 43 |
| 44 void Connect(const BluetoothDeviceWin* device, | 44 void Connect(const BluetoothDeviceWin* device, |
| 45 scoped_refptr<base::SequencedTaskRunner> ui_task_runner, | 45 scoped_refptr<base::SequencedTaskRunner> ui_task_runner, |
| 46 scoped_refptr<BluetoothSocketThreadWin> socket_thread, | 46 scoped_refptr<BluetoothSocketThread> socket_thread, |
| 47 net::NetLog* net_log, | 47 net::NetLog* net_log, |
| 48 const net::NetLog::Source& source, | 48 const net::NetLog::Source& source, |
| 49 const base::Closure& callback, | 49 const base::Closure& callback, |
| 50 const ErrorCallback& error_callback); | 50 const ErrorCallback& error_callback); |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 friend BluetoothProfile; | 53 friend BluetoothProfile; |
| 54 | 54 |
| 55 BluetoothProfileWin(); | 55 BluetoothProfileWin(); |
| 56 virtual ~BluetoothProfileWin(); | 56 virtual ~BluetoothProfileWin(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 78 scoped_refptr<BluetoothAdapter> adapter_; | 78 scoped_refptr<BluetoothAdapter> adapter_; |
| 79 scoped_refptr<BluetoothSocketWin> profile_socket_; | 79 scoped_refptr<BluetoothSocketWin> profile_socket_; |
| 80 base::WeakPtrFactory<BluetoothProfileWin> weak_ptr_factory_; | 80 base::WeakPtrFactory<BluetoothProfileWin> weak_ptr_factory_; |
| 81 | 81 |
| 82 DISALLOW_COPY_AND_ASSIGN(BluetoothProfileWin); | 82 DISALLOW_COPY_AND_ASSIGN(BluetoothProfileWin); |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 } // namespace device | 85 } // namespace device |
| 86 | 86 |
| 87 #endif // DEVICE_BLUETOOTH_BLUETOOTH_PROFILE_WIN_H_ | 87 #endif // DEVICE_BLUETOOTH_BLUETOOTH_PROFILE_WIN_H_ |
| OLD | NEW |