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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 bool DeviceDataManagerX11::IsTouchDataType(const int type) { | 124 bool DeviceDataManagerX11::IsTouchDataType(const int type) { |
125 return (type >= kTouchDataTypeStart) && (type <= kTouchDataTypeEnd); | 125 return (type >= kTouchDataTypeStart) && (type <= kTouchDataTypeEnd); |
126 } | 126 } |
127 | 127 |
128 // static | 128 // static |
129 void DeviceDataManagerX11::CreateInstance() { | 129 void DeviceDataManagerX11::CreateInstance() { |
130 if (instance()) | 130 if (instance()) |
131 return; | 131 return; |
132 | 132 |
133 new DeviceDataManagerX11(); | 133 set_instance(new DeviceDataManagerX11()); |
134 } | 134 } |
135 | 135 |
136 // static | 136 // static |
137 DeviceDataManagerX11* DeviceDataManagerX11::GetInstance() { | 137 DeviceDataManagerX11* DeviceDataManagerX11::GetInstance() { |
138 return static_cast<DeviceDataManagerX11*>(DeviceDataManager::GetInstance()); | 138 return static_cast<DeviceDataManagerX11*>(DeviceDataManager::GetInstance()); |
139 } | 139 } |
140 | 140 |
141 DeviceDataManagerX11::DeviceDataManagerX11() | 141 DeviceDataManagerX11::DeviceDataManagerX11() |
142 : xi_opcode_(-1), | 142 : xi_opcode_(-1), |
143 atom_cache_(gfx::GetXDisplay(), kCachedAtoms), | 143 atom_cache_(gfx::GetXDisplay(), kCachedAtoms), |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 } else { | 770 } else { |
771 keyboards.erase(it); | 771 keyboards.erase(it); |
772 ++blocked_iter; | 772 ++blocked_iter; |
773 } | 773 } |
774 } | 774 } |
775 // Notify base class of updated list. | 775 // Notify base class of updated list. |
776 DeviceDataManager::OnKeyboardDevicesUpdated(keyboards); | 776 DeviceDataManager::OnKeyboardDevicesUpdated(keyboards); |
777 } | 777 } |
778 | 778 |
779 } // namespace ui | 779 } // namespace ui |
OLD | NEW |