Index: ui/events/devices/input_device_manager.cc |
diff --git a/ui/events/devices/input_device_manager.cc b/ui/events/devices/input_device_manager.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b6ca664e25a4f42bf7f4dcd015cf7583e73560b8 |
--- /dev/null |
+++ b/ui/events/devices/input_device_manager.cc |
@@ -0,0 +1,33 @@ |
+// Copyright 2016 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. |
+ |
+#include "ui/events/devices/input_device_manager.h" |
+ |
+namespace ui { |
+ |
+InputDeviceManager* InputDeviceManager::instance_ = nullptr; |
+ |
+// static |
+InputDeviceManager* InputDeviceManager::GetInstance() { |
+ DCHECK(instance_); |
+ return instance_; |
+} |
+ |
+// static |
+bool InputDeviceManager::HasInstance() { |
+ return instance_ != nullptr; |
+} |
+ |
+// static |
+void InputDeviceManager::SetInstance(InputDeviceManager* instance) { |
+ DCHECK(!instance_); |
+ instance_ = instance; |
+} |
+ |
+// static |
+void InputDeviceManager::ClearInstance() { |
+ instance_ = nullptr; |
+} |
+ |
+} // namespace ui |