| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 DEVICE_USB_MOJO_PERMISSION_PROVIDER_H_ | 5 #ifndef DEVICE_USB_MOJO_PERMISSION_PROVIDER_H_ |
| 6 #define DEVICE_USB_MOJO_PERMISSION_PROVIDER_H_ | 6 #define DEVICE_USB_MOJO_PERMISSION_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 namespace device { | 10 namespace device { |
| 11 namespace usb { | 11 namespace usb { |
| 12 | 12 |
| 13 class DeviceInfo; | 13 class DeviceInfo; |
| 14 | 14 |
| 15 // An implementation of this interface must be provided to a DeviceManager in | 15 // An implementation of this interface must be provided to a DeviceManager in |
| 16 // order to implement device permission checks. | 16 // order to implement device permission checks. |
| 17 class PermissionProvider { | 17 class PermissionProvider { |
| 18 public: | 18 public: |
| 19 PermissionProvider(); | 19 PermissionProvider(); |
| 20 virtual ~PermissionProvider(); | 20 virtual ~PermissionProvider(); |
| 21 | 21 |
| 22 virtual bool HasDevicePermission(const DeviceInfo& device_info) const = 0; | 22 virtual bool HasDevicePermission(const DeviceInfo& device_info) const = 0; |
| 23 virtual bool HasConfigurationPermission( | 23 virtual bool HasConfigurationPermission( |
| 24 uint8_t requested_configuration, | 24 uint8_t requested_configuration, |
| 25 const DeviceInfo& device_info) const = 0; | 25 const DeviceInfo& device_info) const = 0; |
| 26 virtual bool HasInterfacePermission(uint8_t requested_interface, | 26 virtual bool HasFunctionPermission(uint8_t requested_function, |
| 27 uint8_t configuration_value, | 27 uint8_t configuration_value, |
| 28 const DeviceInfo& device_info) const = 0; | 28 const DeviceInfo& device_info) const = 0; |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 } // namespace usb | 31 } // namespace usb |
| 32 } // namespace device | 32 } // namespace device |
| 33 | 33 |
| 34 #endif // DEVICE_USB_MOJO_PERMISSION_PROVIDER_H_ | 34 #endif // DEVICE_USB_MOJO_PERMISSION_PROVIDER_H_ |
| OLD | NEW |