Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1071)

Side by Side Diff: ui/events/devices/input_device_observer_win.h

Issue 2690323002: Make Interaction Media Features MQ dynamic on Windows. (Closed)
Patch Set: Only update when ConvertibleSlateMode changes Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 bool IsSlateModeEnabled(base::win::RegKey* key);
32 void NotifyObserversKeyboardDeviceConfigurationChanged();
33 void NotifyObserversMouseDeviceConfigurationChanged();
34 void NotifyObserversTouchpadDeviceConfigurationChanged();
35 void NotifyObserversTouchscreenDeviceConfigurationChanged();
36
37 std::unique_ptr<base::win::RegKey> registry_key_;
38 base::ObserverList<InputDeviceEventObserver> observers_;
39 bool slate_mode_enabled_;
40
41 friend struct base::DefaultSingletonTraits<InputDeviceObserverWin>;
42
43 base::WeakPtrFactory<InputDeviceObserverWin> weak_factory_;
44
45 DISALLOW_COPY_AND_ASSIGN(InputDeviceObserverWin);
46 };
47
48 } // namespace ui
49
50 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_DEVICE_OBSERVER_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698