Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / extensions / common / permissions / usb_device_permission.h
blob881d6dd745598f3c29feb182130f03a82a66bdc6
1 // Copyright 2014 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 EXTENSIONS_COMMON_PERMISSIONS_USB_DEVICE_PERMISSION_H_
6 #define EXTENSIONS_COMMON_PERMISSIONS_USB_DEVICE_PERMISSION_H_
8 #include "base/basictypes.h"
9 #include "extensions/common/permissions/api_permission.h"
10 #include "extensions/common/permissions/set_disjunction_permission.h"
11 #include "extensions/common/permissions/usb_device_permission_data.h"
13 namespace extensions {
15 class UsbDevicePermission
16 : public SetDisjunctionPermission<UsbDevicePermissionData,
17 UsbDevicePermission> {
18 public:
19 struct CheckParam : public APIPermission::CheckParam {
20 CheckParam(uint16 vendor_id, uint16 product_id, int interface_id)
21 : vendor_id(vendor_id),
22 product_id(product_id),
23 interface_id(interface_id) {}
24 const uint16 vendor_id;
25 const uint16 product_id;
26 const int interface_id;
29 explicit UsbDevicePermission(const APIPermissionInfo* info);
30 ~UsbDevicePermission() override;
32 // APIPermission overrides
33 PermissionIDSet GetPermissions() const override;
36 } // namespace extensions
38 #endif // EXTENSIONS_COMMON_PERMISSIONS_USB_DEVICE_PERMISSION_H_