Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Side by Side Diff: chrome/browser/usb/web_usb_permission_bubble_request.h

Issue 1408193003: Add chrome side webusb permission UI code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed mac sources from chrome_browser_ui.gypi Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698