OLD | NEW |
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_PERMISSION_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_USB_WEB_USB_PERMISSION_PROVIDER_H_ |
6 #define CHROME_BROWSER_USB_WEB_USB_PERMISSION_PROVIDER_H_ | 6 #define CHROME_BROWSER_USB_WEB_USB_PERMISSION_PROVIDER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 class WebUSBPermissionProvider : public device::usb::PermissionProvider { | 21 class WebUSBPermissionProvider : public device::usb::PermissionProvider { |
22 public: | 22 public: |
23 explicit WebUSBPermissionProvider( | 23 explicit WebUSBPermissionProvider( |
24 content::RenderFrameHost* render_frame_host); | 24 content::RenderFrameHost* render_frame_host); |
25 ~WebUSBPermissionProvider() override; | 25 ~WebUSBPermissionProvider() override; |
26 | 26 |
27 base::WeakPtr<PermissionProvider> GetWeakPtr(); | 27 base::WeakPtr<PermissionProvider> GetWeakPtr(); |
28 | 28 |
29 // device::usb::PermissionProvider implementation. | 29 // device::usb::PermissionProvider implementation. |
30 bool HasDevicePermission( | 30 bool HasDevicePermission( |
31 const device::usb::DeviceInfo& device_info) const override; | 31 scoped_refptr<const device::UsbDevice> device) const override; |
32 bool HasConfigurationPermission( | 32 bool HasConfigurationPermission( |
33 uint8_t requested_configuration, | 33 uint8_t requested_configuration, |
34 const device::usb::DeviceInfo& device_info) const override; | 34 scoped_refptr<const device::UsbDevice> device) const override; |
35 bool HasFunctionPermission( | 35 bool HasFunctionPermission( |
36 uint8_t requested_function, | 36 uint8_t requested_function, |
37 uint8_t configuration_value, | 37 uint8_t configuration_value, |
38 const device::usb::DeviceInfo& device_info) const override; | 38 scoped_refptr<const device::UsbDevice> device) const override; |
39 | 39 |
40 private: | 40 private: |
41 content::RenderFrameHost* const render_frame_host_; | 41 content::RenderFrameHost* const render_frame_host_; |
42 base::WeakPtrFactory<PermissionProvider> weak_factory_; | 42 base::WeakPtrFactory<PermissionProvider> weak_factory_; |
43 }; | 43 }; |
44 | 44 |
45 #endif // CHROME_BROWSER_USB_WEB_USB_PERMISSION_PROVIDER_H_ | 45 #endif // CHROME_BROWSER_USB_WEB_USB_PERMISSION_PROVIDER_H_ |
OLD | NEW |