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

Side by Side Diff: ui/events/platform/x11/x11_hotplug_event_handler.cc

Issue 791743004: events: Generalize IsTouchscreenInternal to any device type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/ozone/evdev/touch_event_converter_evdev.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/platform/x11/x11_hotplug_event_handler.h" 5 #include "ui/events/platform/x11/x11_hotplug_event_handler.h"
6 6
7 #include <X11/Xatom.h> 7 #include <X11/Xatom.h>
8 #include <X11/extensions/XInput.h> 8 #include <X11/extensions/XInput.h>
9 #include <X11/extensions/XInput2.h> 9 #include <X11/extensions/XInput2.h>
10 10
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 } 292 }
293 } 293 }
294 294
295 for (const TouchClassInfo& info : device_info.touch_class_infos) { 295 for (const TouchClassInfo& info : device_info.touch_class_infos) {
296 is_direct_touch = info.mode == XIDirectTouch; 296 is_direct_touch = info.mode == XIDirectTouch;
297 } 297 }
298 298
299 // Touchscreens should have absolute X and Y axes, and be direct touch 299 // Touchscreens should have absolute X and Y axes, and be direct touch
300 // devices. 300 // devices.
301 if (max_x > 0.0 && max_y > 0.0 && is_direct_touch) { 301 if (max_x > 0.0 && max_y > 0.0 && is_direct_touch) {
302 InputDeviceType type = IsTouchscreenInternal(device_info.path) 302 InputDeviceType type = GetInputDeviceTypeFromPath(device_info.path);
303 ? InputDeviceType::INPUT_DEVICE_INTERNAL
304 : InputDeviceType::INPUT_DEVICE_EXTERNAL;
305 // |max_x| and |max_y| are inclusive values, so we need to add 1 to get 303 // |max_x| and |max_y| are inclusive values, so we need to add 1 to get
306 // the size. 304 // the size.
307 devices.push_back(TouchscreenDevice( 305 devices.push_back(TouchscreenDevice(
308 device_info.id, 306 device_info.id,
309 type, 307 type,
310 device_info.name, 308 device_info.name,
311 gfx::Size(max_x + 1, max_y + 1))); 309 gfx::Size(max_x + 1, max_y + 1)));
312 } 310 }
313 } 311 }
314 312
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 base::WorkerPool::PostTask(FROM_HERE, 372 base::WorkerPool::PostTask(FROM_HERE,
375 base::Bind(&HandleHotplugEventInWorker, 373 base::Bind(&HandleHotplugEventInWorker,
376 device_infos, 374 device_infos,
377 display_state, 375 display_state,
378 base::ThreadTaskRunnerHandle::Get(), 376 base::ThreadTaskRunnerHandle::Get(),
379 callbacks), 377 callbacks),
380 true /* task_is_slow */); 378 true /* task_is_slow */);
381 } 379 }
382 380
383 } // namespace ui 381 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/touch_event_converter_evdev.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698