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

Unified Diff: ui/events/devices/input_device_observer_win.h

Issue 2690323002: Make Interaction Media Features MQ dynamic on Windows. (Closed)
Patch Set: Rebased 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 side-by-side diff with in-line comments
Download patch
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..5579e25ddc2cbb05dd82a75301856d78be878b31
--- /dev/null
+++ b/ui/events/devices/input_device_observer_win.h
@@ -0,0 +1,47 @@
+// Copyright (c) 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 {
+ public:
+ static InputDeviceObserverWin* GetInstance();
+ ~InputDeviceObserverWin();
+
+ void AddObserver(InputDeviceEventObserver* observer);
+ void RemoveObserver(InputDeviceEventObserver* observer);
+
+ protected:
+ InputDeviceObserverWin();
+
+ private:
+ void OnRegistryKeyChanged(base::win::RegKey* key);
+ void NotifyObserversKeyboardDeviceConfigurationChanged();
+ void NotifyObserversMouseDeviceConfigurationChanged();
+ void NotifyObserversTouchpadDeviceConfigurationChanged();
+
+ std::unique_ptr<base::win::RegKey> registry_key_;
+ base::ObserverList<InputDeviceEventObserver> observers_;
+
+ 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_

Powered by Google App Engine
This is Rietveld 408576698