OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_RENDERER_USB_WEB_USB_CLIENT_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_USB_WEB_USB_CLIENT_IMPL_H_ |
6 #define CONTENT_RENDERER_USB_WEB_USB_CLIENT_IMPL_H_ | 6 #define CONTENT_RENDERER_USB_WEB_USB_CLIENT_IMPL_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "components/webusb/public/interfaces/webusb_permission_bubble.mojom.h" |
9 #include "device/devices_app/usb/public/interfaces/device_manager.mojom.h" | 10 #include "device/devices_app/usb/public/interfaces/device_manager.mojom.h" |
10 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBClient.h" | 11 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBClient.h" |
11 | 12 |
12 namespace content { | 13 namespace content { |
13 | 14 |
14 class ServiceRegistry; | 15 class ServiceRegistry; |
15 | 16 |
16 class WebUSBClientImpl : public blink::WebUSBClient { | 17 class WebUSBClientImpl : public blink::WebUSBClient { |
17 public: | 18 public: |
18 explicit WebUSBClientImpl(ServiceRegistry* service_registry); | 19 explicit WebUSBClientImpl(ServiceRegistry* service_registry); |
19 ~WebUSBClientImpl() override; | 20 ~WebUSBClientImpl() override; |
20 | 21 |
21 private: | 22 private: |
22 // blink::WebUSBClient implementation: | 23 // blink::WebUSBClient implementation: |
23 void getDevices(blink::WebUSBClientGetDevicesCallbacks* callbacks) override; | 24 void getDevices(blink::WebUSBClientGetDevicesCallbacks* callbacks) override; |
24 void requestDevice( | 25 void requestDevice( |
25 const blink::WebUSBDeviceRequestOptions& options, | 26 const blink::WebUSBDeviceRequestOptions& options, |
26 blink::WebUSBClientRequestDeviceCallbacks* callbacks) override; | 27 blink::WebUSBClientRequestDeviceCallbacks* callbacks) override; |
27 void setObserver(Observer* observer) override; | 28 void setObserver(Observer* observer) override; |
28 | 29 |
29 device::usb::DeviceManager* GetDeviceManager(); | 30 device::usb::DeviceManager* GetDeviceManager(); |
30 void OnDeviceChangeNotification( | 31 void OnDeviceChangeNotification( |
31 device::usb::DeviceChangeNotificationPtr notification); | 32 device::usb::DeviceChangeNotificationPtr notification); |
32 | 33 |
33 ServiceRegistry* const service_registry_; | 34 ServiceRegistry* const service_registry_; |
34 device::usb::DeviceManagerPtr device_manager_; | 35 device::usb::DeviceManagerPtr device_manager_; |
| 36 webusb::WebUsbPermissionBubblePtr webusb_permission_bubble_; |
35 Observer* observer_ = nullptr; | 37 Observer* observer_ = nullptr; |
36 | 38 |
37 DISALLOW_COPY_AND_ASSIGN(WebUSBClientImpl); | 39 DISALLOW_COPY_AND_ASSIGN(WebUSBClientImpl); |
38 }; | 40 }; |
39 | 41 |
40 } // namespace content | 42 } // namespace content |
41 | 43 |
42 #endif // CONTENT_RENDERER_USB_WEB_USB_CLIENT_IMPL_H_ | 44 #endif // CONTENT_RENDERER_USB_WEB_USB_CLIENT_IMPL_H_ |
OLD | NEW |