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

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

Issue 2028593004: Add new InputDeviceManager interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_keyboard
Patch Set: Fix windows compile error. Created 4 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/touch_factory_x11.h" 5 #include "ui/events/devices/x11/touch_factory_x11.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <X11/Xatom.h> 8 #include <X11/Xatom.h>
9 #include <X11/cursorfont.h> 9 #include <X11/cursorfont.h>
10 #include <X11/extensions/XInput.h> 10 #include <X11/extensions/XInput.h>
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 329
330 void TouchFactory::SetTouchscreensEnabled(bool enabled) { 330 void TouchFactory::SetTouchscreensEnabled(bool enabled) {
331 touch_screens_enabled_ = enabled; 331 touch_screens_enabled_ = enabled;
332 DeviceDataManager::GetInstance()->SetTouchscreensEnabled(enabled); 332 DeviceDataManager::GetInstance()->SetTouchscreensEnabled(enabled);
333 } 333 }
334 334
335 void TouchFactory::CacheTouchscreenIds(int device_id) { 335 void TouchFactory::CacheTouchscreenIds(int device_id) {
336 if (!DeviceDataManager::HasInstance()) 336 if (!DeviceDataManager::HasInstance())
337 return; 337 return;
338 std::vector<TouchscreenDevice> touchscreens = 338 std::vector<TouchscreenDevice> touchscreens =
339 DeviceDataManager::GetInstance()->touchscreen_devices(); 339 DeviceDataManager::GetInstance()->GetTouchscreenDevices();
340 const auto it = 340 const auto it =
341 std::find_if(touchscreens.begin(), touchscreens.end(), 341 std::find_if(touchscreens.begin(), touchscreens.end(),
342 [device_id](const TouchscreenDevice& touchscreen) { 342 [device_id](const TouchscreenDevice& touchscreen) {
343 return touchscreen.id == device_id; 343 return touchscreen.id == device_id;
344 }); 344 });
345 // Internal displays will have a vid and pid of 0. Ignore them. 345 // Internal displays will have a vid and pid of 0. Ignore them.
346 if (it != touchscreens.end() && it->vendor_id && it->product_id) 346 if (it != touchscreens.end() && it->vendor_id && it->product_id)
347 touchscreen_ids_.insert(std::make_pair(it->vendor_id, it->product_id)); 347 touchscreen_ids_.insert(std::make_pair(it->vendor_id, it->product_id));
348 } 348 }
349 349
350 } // namespace ui 350 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/devices/x11/device_data_manager_x11_unittest.cc ('k') | ui/events/x/events_x_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698