| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DISPATCHER_HOST_H_ |
| 6 #define CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DISPATCHER_HOST_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/id_map.h" | 9 #include "base/id_map.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 private: | 52 private: |
| 53 friend class base::DeleteHelper<BluetoothDispatcherHost>; | 53 friend class base::DeleteHelper<BluetoothDispatcherHost>; |
| 54 friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>; | 54 friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>; |
| 55 | 55 |
| 56 struct RequestDeviceSession; | 56 struct RequestDeviceSession; |
| 57 | 57 |
| 58 // Set |adapter_| to a BluetoothAdapter instance and register observers, | 58 // Set |adapter_| to a BluetoothAdapter instance and register observers, |
| 59 // releasing references to previous |adapter_|. | 59 // releasing references to previous |adapter_|. |
| 60 void set_adapter(scoped_refptr<device::BluetoothAdapter> adapter); | 60 void set_adapter(scoped_refptr<device::BluetoothAdapter> adapter); |
| 61 | 61 |
| 62 // Makes sure a BluetoothDiscoverySession is active for |session|, and resets |
| 63 // its timeout. |
| 64 void StartDeviceDiscovery(RequestDeviceSession* session, int chooser_id); |
| 65 |
| 62 // Stops all BluetoothDiscoverySessions being run for requestDevice() | 66 // Stops all BluetoothDiscoverySessions being run for requestDevice() |
| 63 // choosers. | 67 // choosers. |
| 64 void StopDeviceDiscovery(); | 68 void StopDeviceDiscovery(); |
| 65 | 69 |
| 66 // BluetoothAdapter::Observer: | 70 // BluetoothAdapter::Observer: |
| 67 void AdapterPoweredChanged(device::BluetoothAdapter* adapter, | 71 void AdapterPoweredChanged(device::BluetoothAdapter* adapter, |
| 68 bool powered) override; | 72 bool powered) override; |
| 69 void DeviceAdded(device::BluetoothAdapter* adapter, | 73 void DeviceAdded(device::BluetoothAdapter* adapter, |
| 70 device::BluetoothDevice* device) override; | 74 device::BluetoothDevice* device) override; |
| 71 void DeviceRemoved(device::BluetoothAdapter* adapter, | 75 void DeviceRemoved(device::BluetoothAdapter* adapter, |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 189 |
| 186 // Must be last member, see base/memory/weak_ptr.h documentation | 190 // Must be last member, see base/memory/weak_ptr.h documentation |
| 187 base::WeakPtrFactory<BluetoothDispatcherHost> weak_ptr_factory_; | 191 base::WeakPtrFactory<BluetoothDispatcherHost> weak_ptr_factory_; |
| 188 | 192 |
| 189 DISALLOW_COPY_AND_ASSIGN(BluetoothDispatcherHost); | 193 DISALLOW_COPY_AND_ASSIGN(BluetoothDispatcherHost); |
| 190 }; | 194 }; |
| 191 | 195 |
| 192 } // namespace content | 196 } // namespace content |
| 193 | 197 |
| 194 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DISPATCHER_HOST_H_ | 198 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DISPATCHER_HOST_H_ |
| OLD | NEW |