• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 
5 #ifndef EXTENSIONS_COMMON_PERMISSIONS_USB_DEVICE_PERMISSION_H_
6 #define EXTENSIONS_COMMON_PERMISSIONS_USB_DEVICE_PERMISSION_H_
7 
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"
12 
13 namespace extensions {
14 
15 class UsbDevicePermission
16   : public SetDisjunctionPermission<UsbDevicePermissionData,
17                                     UsbDevicePermission> {
18  public:
19   struct CheckParam : public APIPermission::CheckParam {
CheckParamCheckParam20     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;
27   };
28 
29   explicit UsbDevicePermission(const APIPermissionInfo* info);
30   virtual ~UsbDevicePermission();
31 
32   // APIPermission overrides
33   virtual PermissionMessages GetMessages() const OVERRIDE;
34 };
35 
36 }  // namespace extensions
37 
38 #endif  // EXTENSIONS_COMMON_PERMISSIONS_USB_DEVICE_PERMISSION_H_
39