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/ozone/evdev/event_factory_evdev.h" | 5 #include "ui/events/ozone/evdev/event_factory_evdev.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <linux/input.h> | 8 #include <linux/input.h> |
9 | 9 |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 | 322 |
323 if (converter.HasKeyboard()) | 323 if (converter.HasKeyboard()) |
324 NotifyKeyboardsUpdated(); | 324 NotifyKeyboardsUpdated(); |
325 } | 325 } |
326 | 326 |
327 void EventFactoryEvdev::NotifyTouchscreensUpdated() { | 327 void EventFactoryEvdev::NotifyTouchscreensUpdated() { |
328 DeviceHotplugEventObserver* observer = DeviceDataManager::GetInstance(); | 328 DeviceHotplugEventObserver* observer = DeviceDataManager::GetInstance(); |
329 std::vector<TouchscreenDevice> touchscreens; | 329 std::vector<TouchscreenDevice> touchscreens; |
330 for (auto it = converters_.begin(); it != converters_.end(); ++it) { | 330 for (auto it = converters_.begin(); it != converters_.end(); ++it) { |
331 if (it->second->HasTouchscreen()) { | 331 if (it->second->HasTouchscreen()) { |
| 332 // TODO(spang): Extract the number of touch-points supported by the |
| 333 // device. |
| 334 const int touch_points = 11; |
332 touchscreens.push_back(TouchscreenDevice( | 335 touchscreens.push_back(TouchscreenDevice( |
333 it->second->id(), it->second->type(), std::string() /* Device name */, | 336 it->second->id(), it->second->type(), std::string() /* Device name */, |
334 it->second->GetTouchscreenSize())); | 337 it->second->GetTouchscreenSize(), touch_points)); |
335 } | 338 } |
336 } | 339 } |
337 | 340 |
338 observer->OnTouchscreenDevicesUpdated(touchscreens); | 341 observer->OnTouchscreenDevicesUpdated(touchscreens); |
339 } | 342 } |
340 | 343 |
341 void EventFactoryEvdev::NotifyKeyboardsUpdated() { | 344 void EventFactoryEvdev::NotifyKeyboardsUpdated() { |
342 DeviceHotplugEventObserver* observer = DeviceDataManager::GetInstance(); | 345 DeviceHotplugEventObserver* observer = DeviceDataManager::GetInstance(); |
343 std::vector<KeyboardDevice> keyboards; | 346 std::vector<KeyboardDevice> keyboards; |
344 for (auto it = converters_.begin(); it != converters_.end(); ++it) { | 347 for (auto it = converters_.begin(); it != converters_.end(); ++it) { |
(...skipping 21 matching lines...) Expand all Loading... |
366 gesture_property_provider_->GetDeviceIdsByType(type, &ids); | 369 gesture_property_provider_->GetDeviceIdsByType(type, &ids); |
367 #endif | 370 #endif |
368 // In the future we can add other device matching logics here. | 371 // In the future we can add other device matching logics here. |
369 | 372 |
370 if (device_ids) | 373 if (device_ids) |
371 device_ids->assign(ids.begin(), ids.end()); | 374 device_ids->assign(ids.begin(), ids.end()); |
372 return !ids.empty(); | 375 return !ids.empty(); |
373 } | 376 } |
374 | 377 |
375 } // namespace ui | 378 } // namespace ui |
OLD | NEW |