OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/events/devices/x11/device_data_manager_x11.h" | 5 #include "ui/events/devices/x11/device_data_manager_x11.h" |
6 | 6 |
7 #include <X11/extensions/XInput.h> | 7 #include <X11/extensions/XInput.h> |
8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
10 | 10 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 bool DeviceDataManagerX11::IsTouchDataType(const int type) { | 126 bool DeviceDataManagerX11::IsTouchDataType(const int type) { |
127 return (type >= kTouchDataTypeStart) && (type <= kTouchDataTypeEnd); | 127 return (type >= kTouchDataTypeStart) && (type <= kTouchDataTypeEnd); |
128 } | 128 } |
129 | 129 |
130 // static | 130 // static |
131 void DeviceDataManagerX11::CreateInstance() { | 131 void DeviceDataManagerX11::CreateInstance() { |
132 if (instance()) | 132 if (instance()) |
133 return; | 133 return; |
134 | 134 |
135 DeviceDataManagerX11* device_data_manager = new DeviceDataManagerX11(); | 135 DeviceDataManagerX11* device_data_manager = new DeviceDataManagerX11(); |
| 136 |
| 137 // TODO(bruthig): Replace the DeleteInstance callbacks with explicit calls. |
136 base::AtExitManager::RegisterTask( | 138 base::AtExitManager::RegisterTask( |
137 base::Bind(&base::DeletePointer<DeviceDataManager>, device_data_manager)); | 139 base::Bind(DeviceDataManager::DeleteInstance)); |
138 | 140 |
139 set_instance(device_data_manager); | 141 set_instance(device_data_manager); |
140 } | 142 } |
141 | 143 |
142 // static | 144 // static |
143 DeviceDataManagerX11* DeviceDataManagerX11::GetInstance() { | 145 DeviceDataManagerX11* DeviceDataManagerX11::GetInstance() { |
144 return static_cast<DeviceDataManagerX11*>(DeviceDataManager::GetInstance()); | 146 return static_cast<DeviceDataManagerX11*>(DeviceDataManager::GetInstance()); |
145 } | 147 } |
146 | 148 |
147 DeviceDataManagerX11::DeviceDataManagerX11() | 149 DeviceDataManagerX11::DeviceDataManagerX11() |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 } else { | 778 } else { |
777 keyboards.erase(it); | 779 keyboards.erase(it); |
778 ++blocked_iter; | 780 ++blocked_iter; |
779 } | 781 } |
780 } | 782 } |
781 // Notify base class of updated list. | 783 // Notify base class of updated list. |
782 DeviceDataManager::OnKeyboardDevicesUpdated(keyboards); | 784 DeviceDataManager::OnKeyboardDevicesUpdated(keyboards); |
783 } | 785 } |
784 | 786 |
785 } // namespace ui | 787 } // namespace ui |
OLD | NEW |