-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathusb_device_event_observer.h
40 lines (30 loc) · 1.28 KB
/
usb_device_event_observer.h
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
39
40
// Copyright (c) 2013 The Chromium OS 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 MIST_USB_DEVICE_EVENT_OBSERVER_H_
#define MIST_USB_DEVICE_EVENT_OBSERVER_H_
#include <stdint.h>
#include <string>
#include <base/macros.h>
#include <base/observer_list_types.h>
namespace mist {
// An interface class for observing USB device events from
// UsbDeviceEventNotifier.
class UsbDeviceEventObserver : public base::CheckedObserver {
public:
// Invoked when a USB device is added to the system.
virtual void OnUsbDeviceAdded(const std::string& sys_path,
uint8_t bus_number,
uint8_t device_address,
uint16_t vendor_id,
uint16_t product_id) = 0;
// Invoked when a USB device is removed from the system.
virtual void OnUsbDeviceRemoved(const std::string& sys_path) = 0;
protected:
UsbDeviceEventObserver() = default;
UsbDeviceEventObserver(const UsbDeviceEventObserver&) = delete;
UsbDeviceEventObserver& operator=(const UsbDeviceEventObserver&) = delete;
virtual ~UsbDeviceEventObserver() = default;
};
} // namespace mist
#endif // MIST_USB_DEVICE_EVENT_OBSERVER_H_