[WebView] Fix automerger breakage.
[chromium-blink-merge.git] / device / core / device_monitor_win.h
blob57a502ff09755ced7367c668be2ffb9ccf1dc07a
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 DEVICE_CORE_DEVICE_MONITOR_WIN_H_
6 #define DEVICE_CORE_DEVICE_MONITOR_WIN_H_
8 #include <windows.h>
10 #include "base/observer_list.h"
12 namespace device {
14 // Use an instance of this class to observe devices being added and removed
15 // from the system, matched by device interface GUID.
16 class DeviceMonitorWin {
17 public:
18 class Observer {
19 public:
20 virtual void OnDeviceAdded(const std::string& device_path);
21 virtual void OnDeviceRemoved(const std::string& device_path);
24 ~DeviceMonitorWin();
26 static DeviceMonitorWin* GetForDeviceInterface(const GUID& guid);
28 void AddObserver(Observer* observer);
29 void RemoveObserver(Observer* observer);
31 private:
32 friend class DeviceMonitorMessageWindow;
34 DeviceMonitorWin(HDEVNOTIFY notify_handle);
36 void NotifyDeviceAdded(const std::string& device_path);
37 void NotifyDeviceRemoved(const std::string& device_path);
39 ObserverList<Observer> observer_list_;
40 HDEVNOTIFY notify_handle_;
44 #endif // DEVICE_CORE_DEVICE_MONITOR_WIN_H_