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

Side by Side Diff: device/usb/mojo/permission_provider.h

Issue 1854483002: Remove WebUSB descriptor data from device.mojom. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@use_interface_associations
Patch Set: Created 4 years, 8 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 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 #include "base/memory/ref_counted.h"
11
10 namespace device { 12 namespace device {
13
14 class UsbDevice;
15
11 namespace usb { 16 namespace usb {
12 17
13 class DeviceInfo;
14
15 // An implementation of this interface must be provided to a DeviceManager in 18 // An implementation of this interface must be provided to a DeviceManager in
16 // order to implement device permission checks. 19 // order to implement device permission checks.
17 class PermissionProvider { 20 class PermissionProvider {
18 public: 21 public:
19 PermissionProvider(); 22 PermissionProvider();
20 virtual ~PermissionProvider(); 23 virtual ~PermissionProvider();
21 24
22 virtual bool HasDevicePermission(const DeviceInfo& device_info) const = 0; 25 virtual bool HasDevicePermission(
26 scoped_refptr<const UsbDevice> device) const = 0;
23 virtual bool HasConfigurationPermission( 27 virtual bool HasConfigurationPermission(
24 uint8_t requested_configuration, 28 uint8_t requested_configuration,
25 const DeviceInfo& device_info) const = 0; 29 scoped_refptr<const UsbDevice> device) const = 0;
26 virtual bool HasFunctionPermission(uint8_t requested_function, 30 virtual bool HasFunctionPermission(
27 uint8_t configuration_value, 31 uint8_t requested_function,
28 const DeviceInfo& device_info) const = 0; 32 uint8_t configuration_value,
33 scoped_refptr<const UsbDevice> device) const = 0;
29 }; 34 };
30 35
31 } // namespace usb 36 } // namespace usb
32 } // namespace device 37 } // namespace device
33 38
34 #endif // DEVICE_USB_MOJO_PERMISSION_PROVIDER_H_ 39 #endif // DEVICE_USB_MOJO_PERMISSION_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698