summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/permissions/usb_device_permission.h
blob: 211b8ef406c9a8cf8932677550a13bcbc1cc1517 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_COMMON_EXTENSIONS_PERMISSIONS_USB_DEVICE_PERMISSION_H_
#define CHROME_COMMON_EXTENSIONS_PERMISSIONS_USB_DEVICE_PERMISSION_H_

#include "base/basictypes.h"
#include "chrome/common/extensions/permissions/api_permission.h"
#include "chrome/common/extensions/permissions/set_disjunction_permission.h"
#include "chrome/common/extensions/permissions/usb_device_permission_data.h"

namespace extensions {

class UsbDevicePermission
  : public SetDisjunctionPermission<UsbDevicePermissionData,
                                    UsbDevicePermission> {
 public:
  struct CheckParam : public APIPermission::CheckParam {
    CheckParam(uint16 vendor_id, uint16 product_id, int interface_id)
      : vendor_id(vendor_id),
        product_id(product_id),
        interface_id(interface_id) {}
    const uint16 vendor_id;
    const uint16 product_id;
    const int interface_id;
  };

  explicit UsbDevicePermission(const APIPermissionInfo* info);
  virtual ~UsbDevicePermission();

  // APIPermission overrides
  virtual PermissionMessages GetMessages() const OVERRIDE;
};

}  // namespace extensions

#endif  // CHROME_COMMON_EXTENSIONS_PERMISSIONS_USB_DEVICE_PERMISSION_H_