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

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

Issue 1739523002: WebUsb Android chooser UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated comments Created 4 years, 9 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/array.h" 13 #include "mojo/public/cpp/bindings/array.h"
14 #include "mojo/public/cpp/bindings/binding_set.h" 14 #include "mojo/public/cpp/bindings/binding_set.h"
15 #include "mojo/public/cpp/bindings/interface_request.h" 15 #include "mojo/public/cpp/bindings/interface_request.h"
16 16
17 #if defined(OS_ANDROID)
18 #include "base/memory/scoped_ptr.h"
19 class UsbChooserAndroid;
20 #endif // defined(OS_ANDROID)
21
17 namespace content { 22 namespace content {
18 class RenderFrameHost; 23 class RenderFrameHost;
19 } 24 }
20 25
21 namespace device { 26 namespace device {
22 class UsbDevice; 27 class UsbDevice;
23 } 28 }
24 29
25 // Implementation of the public device::usb::ChooserService interface. 30 // Implementation of the public device::usb::ChooserService interface.
26 // This interface can be used by a webpage to request permission from user 31 // This interface can be used by a webpage to request permission from user
27 // to access a certain device. 32 // to access a certain device.
28 class WebUsbChooserService : public device::usb::ChooserService { 33 class WebUsbChooserService : public device::usb::ChooserService {
29 public: 34 public:
30 explicit WebUsbChooserService(content::RenderFrameHost* render_frame_host); 35 explicit WebUsbChooserService(content::RenderFrameHost* render_frame_host);
31 36
32 ~WebUsbChooserService() override; 37 ~WebUsbChooserService() override;
33 38
34 // device::usb::ChooserService: 39 // device::usb::ChooserService:
35 void GetPermission(mojo::Array<device::usb::DeviceFilterPtr> device_filters, 40 void GetPermission(mojo::Array<device::usb::DeviceFilterPtr> device_filters,
36 const GetPermissionCallback& callback) override; 41 const GetPermissionCallback& callback) override;
37 42
38 void Bind(mojo::InterfaceRequest<device::usb::ChooserService> request); 43 void Bind(mojo::InterfaceRequest<device::usb::ChooserService> request);
39 44
40 private: 45 private:
41 content::RenderFrameHost* const render_frame_host_; 46 content::RenderFrameHost* const render_frame_host_;
42 mojo::BindingSet<device::usb::ChooserService> bindings_; 47 mojo::BindingSet<device::usb::ChooserService> bindings_;
43 std::vector<BubbleReference> bubbles_; 48 std::vector<BubbleReference> bubbles_;
44 49
50 #if defined(OS_ANDROID)
51 scoped_ptr<UsbChooserAndroid> usb_chooser_android_;
52 #endif // defined(OS_ANDROID)
Reilly Grant (use Gerrit) 2016/03/03 01:57:56 It seems like there should just be an Android vers
juncai 2016/03/04 01:36:39 Done.
53
45 DISALLOW_COPY_AND_ASSIGN(WebUsbChooserService); 54 DISALLOW_COPY_AND_ASSIGN(WebUsbChooserService);
46 }; 55 };
47 56
48 #endif // CHROME_BROWSER_USB_WEB_USB_CHOOSER_SERVICE_H_ 57 #endif // CHROME_BROWSER_USB_WEB_USB_CHOOSER_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698