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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 const EventConverterEvdev& converter) { | 288 const EventConverterEvdev& converter) { |
289 // For now the only information propagated is related to touchscreens. Ignore | 289 // For now the only information propagated is related to touchscreens. Ignore |
290 // events for everything but touchscreens. | 290 // events for everything but touchscreens. |
291 if (!converter.HasTouchscreen()) | 291 if (!converter.HasTouchscreen()) |
292 return; | 292 return; |
293 | 293 |
294 DeviceHotplugEventObserver* observer = DeviceDataManager::GetInstance(); | 294 DeviceHotplugEventObserver* observer = DeviceDataManager::GetInstance(); |
295 std::vector<TouchscreenDevice> touchscreens; | 295 std::vector<TouchscreenDevice> touchscreens; |
296 for (auto it = converters_.begin(); it != converters_.end(); ++it) { | 296 for (auto it = converters_.begin(); it != converters_.end(); ++it) { |
297 if (it->second->HasTouchscreen()) { | 297 if (it->second->HasTouchscreen()) { |
298 touchscreens.push_back(TouchscreenDevice(it->second->id(), | 298 touchscreens.push_back( |
299 it->second->GetTouchscreenSize(), | 299 TouchscreenDevice(it->second->id(), |
300 false /* is_internal */)); | 300 InputDeviceType::INPUT_DEVICE_EXTERNAL, |
| 301 std::string(), /* Device name */ |
| 302 it->second->GetTouchscreenSize())); |
301 } | 303 } |
302 } | 304 } |
303 | 305 |
304 observer->OnTouchscreenDevicesUpdated(touchscreens); | 306 observer->OnTouchscreenDevicesUpdated(touchscreens); |
305 } | 307 } |
306 | 308 |
307 int EventFactoryEvdev::NextDeviceId() { | 309 int EventFactoryEvdev::NextDeviceId() { |
308 return ++last_device_id_; | 310 return ++last_device_id_; |
309 } | 311 } |
310 | 312 |
311 } // namespace ui | 313 } // namespace ui |
OLD | NEW |