| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_WEB_BLUETOOTH_SERVICE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ |
| 6 #define CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ | 6 #define CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 void CrashRendererAndClosePipe(bad_message::BadMessageReason reason); | 59 void CrashRendererAndClosePipe(bad_message::BadMessageReason reason); |
| 60 | 60 |
| 61 // Sets the connection error handler for WebBluetoothServiceImpl's Binding. | 61 // Sets the connection error handler for WebBluetoothServiceImpl's Binding. |
| 62 void SetClientConnectionErrorHandler(base::Closure closure); | 62 void SetClientConnectionErrorHandler(base::Closure closure); |
| 63 | 63 |
| 64 // Returns whether the device is paired with the |render_frame_host_|'s | 64 // Returns whether the device is paired with the |render_frame_host_|'s |
| 65 // GetLastCommittedOrigin(). | 65 // GetLastCommittedOrigin(). |
| 66 bool IsDevicePaired(const std::string& device_address); | 66 bool IsDevicePaired(const std::string& device_address); |
| 67 | 67 |
| 68 // DJKim |
| 69 void ChangeAdapterDiscoveringForTesting(device::BluetoothAdapter* adapter, |
| 70 bool discovering); |
| 71 |
| 72 bool IsDiscoverySessionActiveForTesting(); |
| 73 |
| 68 private: | 74 private: |
| 69 friend class FrameConnectedBluetoothDevicesTest; | 75 friend class FrameConnectedBluetoothDevicesTest; |
| 70 typedef base::Callback<void(device::BluetoothDevice*)> | 76 typedef base::Callback<void(device::BluetoothDevice*)> |
| 71 PrimaryServicesRequestCallback; | 77 PrimaryServicesRequestCallback; |
| 72 | 78 |
| 73 // WebContentsObserver: | 79 // WebContentsObserver: |
| 74 // These functions should always check that the affected RenderFrameHost | 80 // These functions should always check that the affected RenderFrameHost |
| 75 // is this->render_frame_host_ and not some other frame in the same tab. | 81 // is this->render_frame_host_ and not some other frame in the same tab. |
| 76 void DidFinishNavigation(NavigationHandle* navigation_handle) override; | 82 void DidFinishNavigation(NavigationHandle* navigation_handle) override; |
| 77 | 83 |
| 78 // BluetoothAdapter::Observer: | 84 // BluetoothAdapter::Observer: |
| 79 void AdapterPoweredChanged(device::BluetoothAdapter* adapter, | 85 void AdapterPoweredChanged(device::BluetoothAdapter* adapter, |
| 80 bool powered) override; | 86 bool powered) override; |
| 87 void AdapterDiscoveringChanged(device::BluetoothAdapter* adapter, |
| 88 bool discovering) override; |
| 81 void DeviceAdded(device::BluetoothAdapter* adapter, | 89 void DeviceAdded(device::BluetoothAdapter* adapter, |
| 82 device::BluetoothDevice* device) override; | 90 device::BluetoothDevice* device) override; |
| 83 void DeviceChanged(device::BluetoothAdapter* adapter, | 91 void DeviceChanged(device::BluetoothAdapter* adapter, |
| 84 device::BluetoothDevice* device) override; | 92 device::BluetoothDevice* device) override; |
| 85 void GattServicesDiscovered(device::BluetoothAdapter* adapter, | 93 void GattServicesDiscovered(device::BluetoothAdapter* adapter, |
| 86 device::BluetoothDevice* device) override; | 94 device::BluetoothDevice* device) override; |
| 87 void GattCharacteristicValueChanged( | 95 void GattCharacteristicValueChanged( |
| 88 device::BluetoothAdapter* adapter, | 96 device::BluetoothAdapter* adapter, |
| 89 device::BluetoothRemoteGattCharacteristic* characteristic, | 97 device::BluetoothRemoteGattCharacteristic* characteristic, |
| 90 const std::vector<uint8_t>& value) override; | 98 const std::vector<uint8_t>& value) override; |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 mojo::Binding<blink::mojom::WebBluetoothService> binding_; | 297 mojo::Binding<blink::mojom::WebBluetoothService> binding_; |
| 290 | 298 |
| 291 base::WeakPtrFactory<WebBluetoothServiceImpl> weak_ptr_factory_; | 299 base::WeakPtrFactory<WebBluetoothServiceImpl> weak_ptr_factory_; |
| 292 | 300 |
| 293 DISALLOW_COPY_AND_ASSIGN(WebBluetoothServiceImpl); | 301 DISALLOW_COPY_AND_ASSIGN(WebBluetoothServiceImpl); |
| 294 }; | 302 }; |
| 295 | 303 |
| 296 } // namespace content | 304 } // namespace content |
| 297 | 305 |
| 298 #endif // CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ | 306 #endif // CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ |
| OLD | NEW |