summaryrefslogtreecommitdiff
path: root/chromium/device/usb/mojo/permission_provider.h
blob: 5bb6a7166709c808242d36ce4877607738b82674 (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
// Copyright 2016 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 DEVICE_USB_MOJO_PERMISSION_PROVIDER_H_
#define DEVICE_USB_MOJO_PERMISSION_PROVIDER_H_

#include "base/memory/ref_counted.h"

namespace device {

class UsbDevice;

namespace usb {

// An implementation of this interface must be provided to a DeviceManager in
// order to implement device permission checks.
class PermissionProvider {
 public:
  PermissionProvider();
  virtual ~PermissionProvider();

  virtual bool HasDevicePermission(
      scoped_refptr<const UsbDevice> device) const = 0;
  virtual void IncrementConnectionCount() = 0;
  virtual void DecrementConnectionCount() = 0;
};

}  // namespace usb
}  // namespace device

#endif  // DEVICE_USB_MOJO_PERMISSION_PROVIDER_H_