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_REQUEST_H_ |
| 6 #define CHROME_BROWSER_USB_WEB_USB_PERMISSION_BUBBLE_REQUEST_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" |
| 13 #include "components/webusb/public/interfaces/webusb_permission_bubble.mojom.h" |
| 14 |
| 15 namespace device { |
| 16 class UsbDevice; |
| 17 } |
| 18 |
| 19 // A permission bubble request that presents the user with a chooser to allow |
| 20 // a certain item access or deny all items access. |
| 21 class WebUsbPermissionBubbleRequest { |
| 22 public: |
| 23 WebUsbPermissionBubbleRequest( |
| 24 const std::vector<scoped_refptr<device::UsbDevice>>& devices, |
| 25 const webusb::WebUsbPermissionBubble::GetPermissionCallback& callback); |
| 26 ~WebUsbPermissionBubbleRequest(); |
| 27 |
| 28 void Connect(int index); |
| 29 void Cancel(); |
| 30 |
| 31 const std::vector<std::string>& device_names() const; |
| 32 |
| 33 private: |
| 34 std::vector<std::string> device_names_; |
| 35 std::vector<scoped_refptr<device::UsbDevice>> devices_; |
| 36 int num_devices_; |
| 37 webusb::WebUsbPermissionBubble::GetPermissionCallback callback_; |
| 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(WebUsbPermissionBubbleRequest); |
| 40 }; |
| 41 |
| 42 #endif // CHROME_BROWSER_USB_WEB_USB_PERMISSION_BUBBLE_REQUEST_H_ |
OLD | NEW |