OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2017 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. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_DEVICE_OBSERVER_WIN_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_DEVICE_OBSERVER_WIN_H_ |
| 7 |
| 8 #include "base/observer_list.h" |
| 9 #include "base/win/registry.h" |
| 10 #include "ui/events/devices/input_device_event_observer.h" |
| 11 |
| 12 namespace base { |
| 13 template <typename T> |
| 14 struct DefaultSingletonTraits; |
| 15 } |
| 16 |
| 17 namespace ui { |
| 18 class EVENTS_DEVICES_EXPORT InputDeviceObserverWin { |
| 19 public: |
| 20 static InputDeviceObserverWin* GetInstance(); |
| 21 ~InputDeviceObserverWin(); |
| 22 |
| 23 void AddObserver(InputDeviceEventObserver* observer); |
| 24 void RemoveObserver(InputDeviceEventObserver* observer); |
| 25 |
| 26 protected: |
| 27 InputDeviceObserverWin(); |
| 28 |
| 29 private: |
| 30 void OnRegistryKeyChanged(base::win::RegKey* key); |
| 31 void NotifyObserversKeyboardDeviceConfigurationChanged(); |
| 32 void NotifyObserversMouseDeviceConfigurationChanged(); |
| 33 void NotifyObserversTouchpadDeviceConfigurationChanged(); |
| 34 |
| 35 std::unique_ptr<base::win::RegKey> registry_key_; |
| 36 base::ObserverList<InputDeviceEventObserver> observers_; |
| 37 |
| 38 friend struct base::DefaultSingletonTraits<InputDeviceObserverWin>; |
| 39 |
| 40 base::WeakPtrFactory<InputDeviceObserverWin> weak_factory_; |
| 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(InputDeviceObserverWin); |
| 43 }; |
| 44 |
| 45 } // namespace ui |
| 46 |
| 47 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_DEVICE_OBSERVER_WIN_H_ |
OLD | NEW |