Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / usb / web_usb_permission_provider.h
blobe75ead2c1aa2cdca0113fad3c5f99dfce6ec27c2
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.
5 #ifndef CHROME_BROWSER_USB_WEB_USB_PERMISSION_PROVIDER_H_
6 #define CHROME_BROWSER_USB_WEB_USB_PERMISSION_PROVIDER_H_
8 #include "device/devices_app/usb/public/interfaces/permission_provider.mojom.h"
9 #include "third_party/mojo/src/mojo/public/cpp/bindings/array.h"
10 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h"
11 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h"
13 namespace content {
14 class RenderFrameHost;
17 class WebUSBPermissionProvider : public device::usb::PermissionProvider {
18 public:
19 static void Create(
20 content::RenderFrameHost* render_frame_host,
21 mojo::InterfaceRequest<device::usb::PermissionProvider> request);
23 ~WebUSBPermissionProvider() override;
25 private:
26 WebUSBPermissionProvider(content::RenderFrameHost* render_frame_host,
27 mojo::InterfaceRequest<PermissionProvider> request);
29 // device::usb::PermissionProvider implementation.
30 void HasDevicePermission(
31 mojo::Array<device::usb::DeviceInfoPtr> requested_devices,
32 const HasDevicePermissionCallback& callback) override;
34 mojo::StrongBinding<PermissionProvider> binding_;
35 content::RenderFrameHost* const render_frame_host_;
38 #endif // CHROME_BROWSER_USB_WEB_USB_PERMISSION_PROVIDER_H_