OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_USB_WEB_USB_PERMISSION_BUBBLE_H_ |
| 6 #define CHROME_BROWSER_USB_WEB_USB_PERMISSION_BUBBLE_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "components/webusb/public/interfaces/webusb_permission_bubble.mojom.h" |
| 12 #include "third_party/mojo/src/mojo/public/cpp/bindings/array.h" |
| 13 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h" |
| 14 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" |
| 15 |
| 16 namespace content { |
| 17 class RenderFrameHost; |
| 18 } |
| 19 |
| 20 namespace device { |
| 21 class UsbDevice; |
| 22 } |
| 23 |
| 24 // Implementation of the public webusb::WebUsbPermissionBubble interface. |
| 25 // This interface can be used by a webpage to request permission from user |
| 26 // to access a certain device. |
| 27 class ChromeWebUsbPermissionBubble : public webusb::WebUsbPermissionBubble { |
| 28 public: |
| 29 ChromeWebUsbPermissionBubble( |
| 30 content::RenderFrameHost* render_frame_host, |
| 31 mojo::InterfaceRequest<WebUsbPermissionBubble> request); |
| 32 |
| 33 ~ChromeWebUsbPermissionBubble() override; |
| 34 |
| 35 // webusb::WebUsbPermissionBubble: |
| 36 void GetPermission(mojo::Array<device::usb::DeviceFilterPtr> device_filters, |
| 37 const GetPermissionCallback& callback) override; |
| 38 |
| 39 private: |
| 40 content::RenderFrameHost* const render_frame_host_; |
| 41 mojo::StrongBinding<WebUsbPermissionBubble> binding_; |
| 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(ChromeWebUsbPermissionBubble); |
| 44 }; |
| 45 |
| 46 #endif // CHROME_BROWSER_USB_WEB_USB_PERMISSION_BUBBLE_H_ |
OLD | NEW |