Index: ui/events/devices/input_device_observer_win.h |
diff --git a/ui/events/devices/input_device_observer_win.h b/ui/events/devices/input_device_observer_win.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5579e25ddc2cbb05dd82a75301856d78be878b31 |
--- /dev/null |
+++ b/ui/events/devices/input_device_observer_win.h |
@@ -0,0 +1,47 @@ |
+// Copyright (c) 2017 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 CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_DEVICE_OBSERVER_WIN_H_ |
+#define CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_DEVICE_OBSERVER_WIN_H_ |
+ |
+#include "base/observer_list.h" |
+#include "base/win/registry.h" |
+#include "ui/events/devices/input_device_event_observer.h" |
+ |
+namespace base { |
+template <typename T> |
+struct DefaultSingletonTraits; |
+} |
+ |
+namespace ui { |
+class EVENTS_DEVICES_EXPORT InputDeviceObserverWin { |
+ public: |
+ static InputDeviceObserverWin* GetInstance(); |
+ ~InputDeviceObserverWin(); |
+ |
+ void AddObserver(InputDeviceEventObserver* observer); |
+ void RemoveObserver(InputDeviceEventObserver* observer); |
+ |
+ protected: |
+ InputDeviceObserverWin(); |
+ |
+ private: |
+ void OnRegistryKeyChanged(base::win::RegKey* key); |
+ void NotifyObserversKeyboardDeviceConfigurationChanged(); |
+ void NotifyObserversMouseDeviceConfigurationChanged(); |
+ void NotifyObserversTouchpadDeviceConfigurationChanged(); |
+ |
+ std::unique_ptr<base::win::RegKey> registry_key_; |
+ base::ObserverList<InputDeviceEventObserver> observers_; |
+ |
+ friend struct base::DefaultSingletonTraits<InputDeviceObserverWin>; |
+ |
+ base::WeakPtrFactory<InputDeviceObserverWin> weak_factory_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(InputDeviceObserverWin); |
+}; |
+ |
+} // namespace ui |
+ |
+#endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_DEVICE_OBSERVER_WIN_H_ |