forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinput_device_observer_win.h
46 lines (33 loc) · 1.29 KB
/
input_device_observer_win.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// 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 UI_EVENTS_DEVICES_INPUT_DEVICE_OBSERVER_WIN_H_
#define UI_EVENTS_DEVICES_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 final {
public:
static InputDeviceObserverWin* GetInstance();
~InputDeviceObserverWin();
void AddObserver(InputDeviceEventObserver* observer);
void RemoveObserver(InputDeviceEventObserver* observer);
private:
friend struct base::DefaultSingletonTraits<InputDeviceObserverWin>;
InputDeviceObserverWin();
void OnRegistryKeyChanged();
bool IsSlateModeEnabled();
void NotifyObserversKeyboardDeviceConfigurationChanged();
void NotifyObserversTouchpadDeviceConfigurationChanged();
bool slate_mode_enabled_ = false;
base::win::RegKey registry_key_;
base::ObserverList<InputDeviceEventObserver>::Unchecked observers_;
DISALLOW_COPY_AND_ASSIGN(InputDeviceObserverWin);
};
} // namespace ui
#endif // UI_EVENTS_DEVICES_INPUT_DEVICE_OBSERVER_WIN_H_