| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // |request|: The instance will be bound to this request's pipe. | 54 // |request|: The instance will be bound to this request's pipe. |
| 55 WebBluetoothServiceImpl(RenderFrameHost* render_frame_host, | 55 WebBluetoothServiceImpl(RenderFrameHost* render_frame_host, |
| 56 blink::mojom::WebBluetoothServiceRequest request); | 56 blink::mojom::WebBluetoothServiceRequest request); |
| 57 ~WebBluetoothServiceImpl() override; | 57 ~WebBluetoothServiceImpl() override; |
| 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 |
| 65 // GetLastCommittedOrigin(). |
| 66 bool IsDevicePaired(const std::string& device_address); |
| 67 |
| 64 private: | 68 private: |
| 65 friend class FrameConnectedBluetoothDevicesTest; | 69 friend class FrameConnectedBluetoothDevicesTest; |
| 66 typedef base::Callback<void(device::BluetoothDevice*)> | 70 typedef base::Callback<void(device::BluetoothDevice*)> |
| 67 PrimaryServicesRequestCallback; | 71 PrimaryServicesRequestCallback; |
| 68 | 72 |
| 69 // WebContentsObserver: | 73 // WebContentsObserver: |
| 70 // These functions should always check that the affected RenderFrameHost | 74 // These functions should always check that the affected RenderFrameHost |
| 71 // is this->render_frame_host_ and not some other frame in the same tab. | 75 // is this->render_frame_host_ and not some other frame in the same tab. |
| 72 void DidFinishNavigation(NavigationHandle* navigation_handle) override; | 76 void DidFinishNavigation(NavigationHandle* navigation_handle) override; |
| 73 | 77 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 mojo::Binding<blink::mojom::WebBluetoothService> binding_; | 253 mojo::Binding<blink::mojom::WebBluetoothService> binding_; |
| 250 | 254 |
| 251 base::WeakPtrFactory<WebBluetoothServiceImpl> weak_ptr_factory_; | 255 base::WeakPtrFactory<WebBluetoothServiceImpl> weak_ptr_factory_; |
| 252 | 256 |
| 253 DISALLOW_COPY_AND_ASSIGN(WebBluetoothServiceImpl); | 257 DISALLOW_COPY_AND_ASSIGN(WebBluetoothServiceImpl); |
| 254 }; | 258 }; |
| 255 | 259 |
| 256 } // namespace content | 260 } // namespace content |
| 257 | 261 |
| 258 #endif // CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ | 262 #endif // CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ |
| OLD | NEW |