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

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

Issue 1408193003: Add chrome side webusb permission UI code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed some redundant code Created 5 years, 1 month 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_USB_CHOOSER_OPTIONS_H_
6 #define CHROME_BROWSER_USB_USB_CHOOSER_OPTIONS_H_
7
8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/scoped_observer.h"
11 #include "chrome/browser/ui/website_settings/chooser_options.h"
12 #include "components/webusb/public/interfaces/webusb_permission_bubble.mojom.h"
13 #include "device/usb/usb_service.h"
14 #include "mojo/public/cpp/bindings/array.h"
15 #include "url/gurl.h"
16
17 namespace content {
18 class RenderFrameHost;
19 }
20
21 namespace device {
22 class UsbDevice;
23 class UsbDeviceFilter;
24 }
25
26 class UsbChooserOptions : public ChooserOptions,
27 public device::UsbService::Observer {
28 public:
29 UsbChooserOptions(
30 mojo::Array<device::usb::DeviceFilterPtr> device_filters,
31 content::RenderFrameHost* render_frame_host,
32 const webusb::WebUsbPermissionBubble::GetPermissionCallback& callback);
33 ~UsbChooserOptions() override;
34
35 // ChooserOptions:
36 const std::vector<base::string16>& GetOptions() const override;
37 void Select(int index) override;
38
39 // device::UsbService::Observer:
40 void OnDeviceAdded(scoped_refptr<device::UsbDevice> device) override;
41 void OnDeviceRemoved(scoped_refptr<device::UsbDevice> device) override;
42
43 void GetUsbDevicesList(
Reilly Grant (use Gerrit) 2015/11/16 22:45:46 s/GetUsbDevicesList/GotUsbDeviceList/
juncai 2015/11/17 03:42:15 Done.
44 const std::vector<scoped_refptr<device::UsbDevice>>& devices);
45
46 private:
47 std::vector<scoped_refptr<device::UsbDevice>> devices_;
48 std::vector<base::string16> devices_names_;
49 mojo::Array<device::usb::DeviceFilterPtr> device_filters_;
50 std::vector<device::UsbDeviceFilter> filters_;
51 GURL origin_;
52 content::RenderFrameHost* const render_frame_host_;
53 webusb::WebUsbPermissionBubble::GetPermissionCallback callback_;
54 ScopedObserver<device::UsbService, device::UsbService::Observer>
55 usb_service_observer_;
56
57 DISALLOW_COPY_AND_ASSIGN(UsbChooserOptions);
58 };
59
60 #endif // CHROME_BROWSER_USB_USB_CHOOSER_OPTIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698