Chromium Code Reviews| 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..fd0f5b46abb84f0fa06d1c72f0d67b9bcd17b84f |
| --- /dev/null |
| +++ b/ui/events/devices/input_device_observer_win.h |
| @@ -0,0 +1,48 @@ |
| +// Copyright 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 { |
|
sadrul
2017/05/10 01:38:32
Can this be an InputDeviceManager? e.g.
class Inp
|
| + public: |
| + static InputDeviceObserverWin* GetInstance(); |
| + ~InputDeviceObserverWin(); |
| + |
| + void AddObserver(InputDeviceEventObserver* observer); |
| + void RemoveObserver(InputDeviceEventObserver* observer); |
| + |
| + protected: |
| + InputDeviceObserverWin(); |
| + |
| + private: |
| + void OnRegistryKeyChanged(base::win::RegKey* key); |
| + bool IsSlateModeEnabled(base::win::RegKey* key); |
| + void NotifyObserversKeyboardDeviceConfigurationChanged(); |
| + void NotifyObserversTouchpadDeviceConfigurationChanged(); |
| + |
| + std::unique_ptr<base::win::RegKey> registry_key_; |
| + base::ObserverList<InputDeviceEventObserver> observers_; |
| + bool slate_mode_enabled_; |
| + |
| + 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_ |