[Extensions Page] Fix focus when an extension is removed
[chromium-blink-merge.git] / device / core / device_monitor_win.h
blobf6bc5dc22a65db9bd8af2a9eff3ed467b213bbe5
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 GUID& class_guid,
21 const std::string& device_path);
22 virtual void OnDeviceRemoved(const GUID& class_guid,
23 const std::string& device_path);
26 ~DeviceMonitorWin();
28 static DeviceMonitorWin* GetForDeviceInterface(const GUID& guid);
29 static DeviceMonitorWin* GetForAllInterfaces();
31 void AddObserver(Observer* observer);
32 void RemoveObserver(Observer* observer);
34 private:
35 friend class DeviceMonitorMessageWindow;
37 DeviceMonitorWin();
39 void NotifyDeviceAdded(const GUID& class_guid,
40 const std::string& device_path);
41 void NotifyDeviceRemoved(const GUID& class_guid,
42 const std::string& device_path);
44 ObserverList<Observer> observer_list_;
47 } // namespace device
49 #endif // DEVICE_CORE_DEVICE_MONITOR_WIN_H_