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

Side by Side Diff: ui/events/test/events_test_utils_x11.cc

Issue 280833002: Re-land "Issue 191223007: Move touch CTM from X into Chrome" (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: adding missing file again Created 6 years, 7 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
« no previous file with comments | « ui/events/events.gyp ('k') | ui/events/x/device_data_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/test/events_test_utils_x11.h" 5 #include "ui/events/test/events_test_utils_x11.h"
6 6
7 #include <X11/extensions/XI2.h> 7 #include <X11/extensions/XI2.h>
8 #include <X11/keysym.h> 8 #include <X11/keysym.h>
9 #include <X11/X.h> 9 #include <X11/X.h>
10 #include <X11/Xlib.h> 10 #include <X11/Xlib.h>
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 event->xcookie.data = new XIDeviceEvent; 102 event->xcookie.data = new XIDeviceEvent;
103 XIDeviceEvent* xiev = 103 XIDeviceEvent* xiev =
104 static_cast<XIDeviceEvent*>(event->xcookie.data); 104 static_cast<XIDeviceEvent*>(event->xcookie.data);
105 memset(xiev, 0, sizeof(XIDeviceEvent)); 105 memset(xiev, 0, sizeof(XIDeviceEvent));
106 xiev->deviceid = deviceid; 106 xiev->deviceid = deviceid;
107 xiev->sourceid = deviceid; 107 xiev->sourceid = deviceid;
108 xiev->evtype = evtype; 108 xiev->evtype = evtype;
109 xiev->detail = tracking_id; 109 xiev->detail = tracking_id;
110 xiev->event_x = location.x(); 110 xiev->event_x = location.x();
111 xiev->event_y = location.y(); 111 xiev->event_y = location.y();
112 xiev->event = DefaultRootWindow(gfx::GetXDisplay());
112 if (evtype == XI_ButtonPress || evtype == XI_ButtonRelease) { 113 if (evtype == XI_ButtonPress || evtype == XI_ButtonRelease) {
113 xiev->buttons.mask_len = 8; 114 xiev->buttons.mask_len = 8;
114 xiev->buttons.mask = new unsigned char[xiev->buttons.mask_len]; 115 xiev->buttons.mask = new unsigned char[xiev->buttons.mask_len];
115 memset(xiev->buttons.mask, 0, xiev->buttons.mask_len); 116 memset(xiev->buttons.mask, 0, xiev->buttons.mask_len);
116 } 117 }
117 return event; 118 return event;
118 } 119 }
119 120
120 } // namespace 121 } // namespace
121 122
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 manager->SetDeviceListForTest(std::vector<unsigned int>(), device_list); 258 manager->SetDeviceListForTest(std::vector<unsigned int>(), device_list);
258 } 259 }
259 260
260 void SetUpTouchDevicesForTest(const std::vector<unsigned int>& devices) { 261 void SetUpTouchDevicesForTest(const std::vector<unsigned int>& devices) {
261 TouchFactory::GetInstance()->SetTouchDeviceForTest(devices); 262 TouchFactory::GetInstance()->SetTouchDeviceForTest(devices);
262 ui::DeviceDataManager* manager = ui::DeviceDataManager::GetInstance(); 263 ui::DeviceDataManager* manager = ui::DeviceDataManager::GetInstance();
263 manager->SetDeviceListForTest(devices, std::vector<unsigned int>()); 264 manager->SetDeviceListForTest(devices, std::vector<unsigned int>());
264 } 265 }
265 266
266 } // namespace ui 267 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/events.gyp ('k') | ui/events/x/device_data_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698