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 #include "content/renderer/bluetooth/web_bluetooth_impl.h" | 5 #include "content/renderer/bluetooth/web_bluetooth_impl.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 namespace { | 29 namespace { |
30 | 30 |
31 // Blink can't use non-blink mojo enums like blink::mojom::WebBluetoothResult, | 31 // Blink can't use non-blink mojo enums like blink::mojom::WebBluetoothResult, |
32 // so we pass it as an int32 across the boundary. | 32 // so we pass it as an int32 across the boundary. |
33 int32_t ToInt32(blink::mojom::WebBluetoothResult result) { | 33 int32_t ToInt32(blink::mojom::WebBluetoothResult result) { |
34 return static_cast<int32_t>(result); | 34 return static_cast<int32_t>(result); |
35 } | 35 } |
36 | 36 |
37 } // namespace | 37 } // namespace |
38 | 38 |
39 WebBluetoothImpl::WebBluetoothImpl(shell::InterfaceProvider* remote_interfaces) | 39 WebBluetoothImpl::WebBluetoothImpl( |
| 40 service_manager::InterfaceProvider* remote_interfaces) |
40 : remote_interfaces_(remote_interfaces), binding_(this) {} | 41 : remote_interfaces_(remote_interfaces), binding_(this) {} |
41 | 42 |
42 WebBluetoothImpl::~WebBluetoothImpl() { | 43 WebBluetoothImpl::~WebBluetoothImpl() { |
43 } | 44 } |
44 | 45 |
45 void WebBluetoothImpl::requestDevice( | 46 void WebBluetoothImpl::requestDevice( |
46 const blink::WebRequestDeviceOptions& options, | 47 const blink::WebRequestDeviceOptions& options, |
47 blink::WebBluetoothRequestDeviceCallbacks* callbacks) { | 48 blink::WebBluetoothRequestDeviceCallbacks* callbacks) { |
48 GetWebBluetoothService().RequestDevice( | 49 GetWebBluetoothService().RequestDevice( |
49 blink::mojom::WebBluetoothRequestDeviceOptions::From(options), | 50 blink::mojom::WebBluetoothRequestDeviceOptions::From(options), |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 // Create an associated interface ptr and pass it to the WebBluetoothService | 323 // Create an associated interface ptr and pass it to the WebBluetoothService |
323 // so that it can send us events without us prompting. | 324 // so that it can send us events without us prompting. |
324 blink::mojom::WebBluetoothServiceClientAssociatedPtrInfo ptr_info; | 325 blink::mojom::WebBluetoothServiceClientAssociatedPtrInfo ptr_info; |
325 binding_.Bind(&ptr_info, web_bluetooth_service_.associated_group()); | 326 binding_.Bind(&ptr_info, web_bluetooth_service_.associated_group()); |
326 web_bluetooth_service_->SetClient(std::move(ptr_info)); | 327 web_bluetooth_service_->SetClient(std::move(ptr_info)); |
327 } | 328 } |
328 return *web_bluetooth_service_; | 329 return *web_bluetooth_service_; |
329 } | 330 } |
330 | 331 |
331 } // namespace content | 332 } // namespace content |
OLD | NEW |