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

Side by Side Diff: ui/events/devices/x11/device_data_manager_x11.cc

Issue 1202383002: Changed DeviceDataManager to be able to create multiple instances for the purposes of test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
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
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
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
OLDNEW
« ui/events/devices/device_data_manager.cc ('K') | « ui/events/devices/device_data_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698