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 12 matching lines...) Expand all Loading... |
23 #include "mojo/public/cpp/bindings/binding.h" | 23 #include "mojo/public/cpp/bindings/binding.h" |
24 #include "third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.moj
om.h" | 24 #include "third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.moj
om.h" |
25 | 25 |
26 namespace url { | 26 namespace url { |
27 class Origin; | 27 class Origin; |
28 } // namespace url | 28 } // namespace url |
29 | 29 |
30 namespace content { | 30 namespace content { |
31 | 31 |
32 class BluetoothDeviceChooserController; | 32 class BluetoothDeviceChooserController; |
33 class BluetoothAdapterFactoryWrapper; | |
34 class FrameConnectedBluetoothDevices; | 33 class FrameConnectedBluetoothDevices; |
35 class RenderFrameHost; | 34 class RenderFrameHost; |
36 class RenderProcessHost; | 35 class RenderProcessHost; |
37 | 36 |
38 // Implementation of Mojo WebBluetoothService located in | 37 // Implementation of Mojo WebBluetoothService located in |
39 // third_party/WebKit/public/platform/modules/bluetooth. | 38 // third_party/WebKit/public/platform/modules/bluetooth. |
40 // It handles Web Bluetooth API requests coming from Blink / renderer | 39 // It handles Web Bluetooth API requests coming from Blink / renderer |
41 // process and uses the platform abstraction of device/bluetooth. | 40 // process and uses the platform abstraction of device/bluetooth. |
42 // WebBluetoothServiceImpl is not thread-safe and should be created on the | 41 // WebBluetoothServiceImpl is not thread-safe and should be created on the |
43 // UI thread as required by device/bluetooth. | 42 // UI thread as required by device/bluetooth. |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 // in the |outcome| field, and |device| and |service| fields if successful. | 196 // in the |outcome| field, and |device| and |service| fields if successful. |
198 CacheQueryResult QueryCacheForService(const std::string& service_instance_id); | 197 CacheQueryResult QueryCacheForService(const std::string& service_instance_id); |
199 | 198 |
200 // Queries the platform cache for a characteristic with | 199 // Queries the platform cache for a characteristic with |
201 // |characteristic_instance_id|. Fills in the |outcome| field, and |device|, | 200 // |characteristic_instance_id|. Fills in the |outcome| field, and |device|, |
202 // |service| and |characteristic| fields if successful. | 201 // |service| and |characteristic| fields if successful. |
203 CacheQueryResult QueryCacheForCharacteristic( | 202 CacheQueryResult QueryCacheForCharacteristic( |
204 const std::string& characteristic_instance_id); | 203 const std::string& characteristic_instance_id); |
205 | 204 |
206 RenderProcessHost* GetRenderProcessHost(); | 205 RenderProcessHost* GetRenderProcessHost(); |
207 BluetoothAdapterFactoryWrapper* GetBluetoothAdapterFactoryWrapper(); | |
208 device::BluetoothAdapter* GetAdapter(); | 206 device::BluetoothAdapter* GetAdapter(); |
209 url::Origin GetOrigin(); | 207 url::Origin GetOrigin(); |
210 | 208 |
211 // Clears all state (maps, sets, etc). | 209 // Clears all state (maps, sets, etc). |
212 void ClearState(); | 210 void ClearState(); |
213 | 211 |
214 // Used to open a BluetoothChooser and start a device discovery session. | 212 // Used to open a BluetoothChooser and start a device discovery session. |
215 std::unique_ptr<BluetoothDeviceChooserController> device_chooser_controller_; | 213 std::unique_ptr<BluetoothDeviceChooserController> device_chooser_controller_; |
216 | 214 |
217 // Keeps track of which devices the frame's origin is allowed to access. | 215 // Keeps track of which devices the frame's origin is allowed to access. |
(...skipping 28 matching lines...) Expand all Loading... |
246 mojo::Binding<blink::mojom::WebBluetoothService> binding_; | 244 mojo::Binding<blink::mojom::WebBluetoothService> binding_; |
247 | 245 |
248 base::WeakPtrFactory<WebBluetoothServiceImpl> weak_ptr_factory_; | 246 base::WeakPtrFactory<WebBluetoothServiceImpl> weak_ptr_factory_; |
249 | 247 |
250 DISALLOW_COPY_AND_ASSIGN(WebBluetoothServiceImpl); | 248 DISALLOW_COPY_AND_ASSIGN(WebBluetoothServiceImpl); |
251 }; | 249 }; |
252 | 250 |
253 } // namespace content | 251 } // namespace content |
254 | 252 |
255 #endif // CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ | 253 #endif // CONTENT_BROWSER_BLUETOOTH_WEB_BLUETOOTH_SERVICE_IMPL_H_ |
OLD | NEW |