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

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

Issue 2615353002: Typemap device.usb.DeviceFilter to device::UsbDeviceFilter. (Closed)
Patch Set: Addressed juncai@'s feedback. Created 3 years, 11 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
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 CHROME_BROWSER_USB_WEB_USB_CHOOSER_SERVICE_H_ 5 #ifndef CHROME_BROWSER_USB_WEB_USB_CHOOSER_SERVICE_H_
6 #define CHROME_BROWSER_USB_WEB_USB_CHOOSER_SERVICE_H_ 6 #define CHROME_BROWSER_USB_WEB_USB_CHOOSER_SERVICE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "components/bubble/bubble_reference.h" 11 #include "components/bubble/bubble_reference.h"
12 #include "device/usb/public/interfaces/chooser_service.mojom.h" 12 #include "device/usb/public/interfaces/chooser_service.mojom.h"
13 #include "mojo/public/cpp/bindings/binding_set.h" 13 #include "mojo/public/cpp/bindings/binding_set.h"
14 #include "mojo/public/cpp/bindings/interface_request.h" 14 #include "mojo/public/cpp/bindings/interface_request.h"
15 15
16 namespace content { 16 namespace content {
17 class RenderFrameHost; 17 class RenderFrameHost;
18 } 18 }
19 19
20 // Implementation of the public device::usb::ChooserService interface. 20 // Implementation of the public device::usb::ChooserService interface.
21 // This interface can be used by a webpage to request permission from user 21 // This interface can be used by a webpage to request permission from user
22 // to access a certain device. 22 // to access a certain device.
23 class WebUsbChooserService : public device::usb::ChooserService { 23 class WebUsbChooserService : public device::usb::ChooserService {
24 public: 24 public:
25 explicit WebUsbChooserService(content::RenderFrameHost* render_frame_host); 25 explicit WebUsbChooserService(content::RenderFrameHost* render_frame_host);
26 26
27 ~WebUsbChooserService() override; 27 ~WebUsbChooserService() override;
28 28
29 // device::usb::ChooserService: 29 // device::usb::ChooserService:
30 void GetPermission(std::vector<device::usb::DeviceFilterPtr> device_filters, 30 void GetPermission(const std::vector<device::UsbDeviceFilter>& device_filters,
31 const GetPermissionCallback& callback) override; 31 const GetPermissionCallback& callback) override;
32 32
33 void Bind(mojo::InterfaceRequest<device::usb::ChooserService> request); 33 void Bind(mojo::InterfaceRequest<device::usb::ChooserService> request);
34 34
35 private: 35 private:
36 content::RenderFrameHost* const render_frame_host_; 36 content::RenderFrameHost* const render_frame_host_;
37 mojo::BindingSet<device::usb::ChooserService> bindings_; 37 mojo::BindingSet<device::usb::ChooserService> bindings_;
38 std::vector<BubbleReference> bubbles_; 38 std::vector<BubbleReference> bubbles_;
39 39
40 DISALLOW_COPY_AND_ASSIGN(WebUsbChooserService); 40 DISALLOW_COPY_AND_ASSIGN(WebUsbChooserService);
41 }; 41 };
42 42
43 #endif // CHROME_BROWSER_USB_WEB_USB_CHOOSER_SERVICE_H_ 43 #endif // CHROME_BROWSER_USB_WEB_USB_CHOOSER_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/usb/usb_chooser_controller_unittest.cc ('k') | chrome/browser/usb/web_usb_chooser_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698