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

Side by Side Diff: trunk/src/device/bluetooth/bluetooth_device_win.h

Issue 227493006: Revert 262175 "* Replace "read" method with onReceiveXxx events." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_WIN_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WIN_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WIN_H_ 6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WIN_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "device/bluetooth/bluetooth_device.h" 12 #include "device/bluetooth/bluetooth_device.h"
13 #include "device/bluetooth/bluetooth_task_manager_win.h" 13 #include "device/bluetooth/bluetooth_task_manager_win.h"
14 14
15 namespace device { 15 namespace device {
16 16
17 class BluetoothAdapterWin; 17 class BluetoothAdapterWin;
18 class BluetoothServiceRecord; 18 class BluetoothServiceRecord;
19 class BluetoothSocketThreadWin;
20 19
21 class BluetoothDeviceWin : public BluetoothDevice { 20 class BluetoothDeviceWin : public BluetoothDevice {
22 public: 21 public:
23 explicit BluetoothDeviceWin( 22 explicit BluetoothDeviceWin(
24 const BluetoothTaskManagerWin::DeviceState& state, 23 const BluetoothTaskManagerWin::DeviceState& state);
25 scoped_refptr<base::SequencedTaskRunner> ui_task_runner,
26 scoped_refptr<BluetoothSocketThreadWin> socket_thread,
27 net::NetLog* net_log,
28 const net::NetLog::Source& net_log_source);
29 virtual ~BluetoothDeviceWin(); 24 virtual ~BluetoothDeviceWin();
30 25
31 // BluetoothDevice override 26 // BluetoothDevice override
32 virtual uint32 GetBluetoothClass() const OVERRIDE; 27 virtual uint32 GetBluetoothClass() const OVERRIDE;
33 virtual std::string GetAddress() const OVERRIDE; 28 virtual std::string GetAddress() const OVERRIDE;
34 virtual VendorIDSource GetVendorIDSource() const OVERRIDE; 29 virtual VendorIDSource GetVendorIDSource() const OVERRIDE;
35 virtual uint16 GetVendorID() const OVERRIDE; 30 virtual uint16 GetVendorID() const OVERRIDE;
36 virtual uint16 GetProductID() const OVERRIDE; 31 virtual uint16 GetProductID() const OVERRIDE;
37 virtual uint16 GetDeviceID() const OVERRIDE; 32 virtual uint16 GetDeviceID() const OVERRIDE;
38 virtual bool IsPaired() const OVERRIDE; 33 virtual bool IsPaired() const OVERRIDE;
(...skipping 16 matching lines...) Expand all
55 virtual void Disconnect( 50 virtual void Disconnect(
56 const base::Closure& callback, 51 const base::Closure& callback,
57 const ErrorCallback& error_callback) OVERRIDE; 52 const ErrorCallback& error_callback) OVERRIDE;
58 virtual void Forget(const ErrorCallback& error_callback) OVERRIDE; 53 virtual void Forget(const ErrorCallback& error_callback) OVERRIDE;
59 virtual void ConnectToService( 54 virtual void ConnectToService(
60 const device::BluetoothUUID& service_uuid, 55 const device::BluetoothUUID& service_uuid,
61 const SocketCallback& callback) OVERRIDE; 56 const SocketCallback& callback) OVERRIDE;
62 virtual void ConnectToProfile( 57 virtual void ConnectToProfile(
63 device::BluetoothProfile* profile, 58 device::BluetoothProfile* profile,
64 const base::Closure& callback, 59 const base::Closure& callback,
65 const ConnectToProfileErrorCallback& error_callback) OVERRIDE; 60 const ErrorCallback& error_callback) OVERRIDE;
66 virtual void SetOutOfBandPairingData( 61 virtual void SetOutOfBandPairingData(
67 const BluetoothOutOfBandPairingData& data, 62 const BluetoothOutOfBandPairingData& data,
68 const base::Closure& callback, 63 const base::Closure& callback,
69 const ErrorCallback& error_callback) OVERRIDE; 64 const ErrorCallback& error_callback) OVERRIDE;
70 virtual void ClearOutOfBandPairingData( 65 virtual void ClearOutOfBandPairingData(
71 const base::Closure& callback, 66 const base::Closure& callback,
72 const ErrorCallback& error_callback) OVERRIDE; 67 const ErrorCallback& error_callback) OVERRIDE;
73 68
74 // Used by BluetoothProfileWin to retrieve the service record for the given 69 // Used by BluetoothProfileWin to retrieve the service record for the given
75 // |uuid|. 70 // |uuid|.
76 const BluetoothServiceRecord* GetServiceRecord( 71 const BluetoothServiceRecord* GetServiceRecord(
77 const device::BluetoothUUID& uuid) const; 72 const device::BluetoothUUID& uuid) const;
78 73
79 protected: 74 protected:
80 // BluetoothDevice override 75 // BluetoothDevice override
81 virtual std::string GetDeviceName() const OVERRIDE; 76 virtual std::string GetDeviceName() const OVERRIDE;
82 77
83 private: 78 private:
84 friend class BluetoothAdapterWin; 79 friend class BluetoothAdapterWin;
85 80
86 // Used by BluetoothAdapterWin to update the visible state during 81 // Used by BluetoothAdapterWin to update the visible state during
87 // discovery. 82 // discovery.
88 void SetVisible(bool visible); 83 void SetVisible(bool visible);
89 84
90 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_;
91 scoped_refptr<BluetoothSocketThreadWin> socket_thread_;
92 net::NetLog* net_log_;
93 net::NetLog::Source net_log_source_;
94
95 // The Bluetooth class of the device, a bitmask that may be decoded using 85 // The Bluetooth class of the device, a bitmask that may be decoded using
96 // https://www.bluetooth.org/Technical/AssignedNumbers/baseband.htm 86 // https://www.bluetooth.org/Technical/AssignedNumbers/baseband.htm
97 uint32 bluetooth_class_; 87 uint32 bluetooth_class_;
98 88
99 // The name of the device, as supplied by the remote device. 89 // The name of the device, as supplied by the remote device.
100 std::string name_; 90 std::string name_;
101 91
102 // The Bluetooth address of the device. 92 // The Bluetooth address of the device.
103 std::string address_; 93 std::string address_;
104 94
(...skipping 12 matching lines...) Expand all
117 // The service records retrieved from SDP. 107 // The service records retrieved from SDP.
118 typedef ScopedVector<BluetoothServiceRecord> ServiceRecordList; 108 typedef ScopedVector<BluetoothServiceRecord> ServiceRecordList;
119 ServiceRecordList service_record_list_; 109 ServiceRecordList service_record_list_;
120 110
121 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceWin); 111 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceWin);
122 }; 112 };
123 113
124 } // namespace device 114 } // namespace device
125 115
126 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WIN_H_ 116 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_WIN_H_
OLDNEW
« no previous file with comments | « trunk/src/device/bluetooth/bluetooth_device_mac.mm ('k') | trunk/src/device/bluetooth/bluetooth_device_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698