Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 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 { | |
|
sadrul
2017/05/10 01:38:32
Can this be an InputDeviceManager? e.g.
class Inp
| |
| 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 bool IsSlateModeEnabled(base::win::RegKey* key); | |
| 32 void NotifyObserversKeyboardDeviceConfigurationChanged(); | |
| 33 void NotifyObserversTouchpadDeviceConfigurationChanged(); | |
| 34 | |
| 35 std::unique_ptr<base::win::RegKey> registry_key_; | |
| 36 base::ObserverList<InputDeviceEventObserver> observers_; | |
| 37 bool slate_mode_enabled_; | |
| 38 | |
| 39 friend struct base::DefaultSingletonTraits<InputDeviceObserverWin>; | |
| 40 | |
| 41 base::WeakPtrFactory<InputDeviceObserverWin> weak_factory_; | |
| 42 | |
| 43 DISALLOW_COPY_AND_ASSIGN(InputDeviceObserverWin); | |
| 44 }; | |
| 45 | |
| 46 } // namespace ui | |
| 47 | |
| 48 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_DEVICE_OBSERVER_WIN_H_ | |
| OLD | NEW |