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

Side by Side Diff: ui/events/ozone/evdev/event_factory_evdev.cc

Issue 2655303004: Add id properties to PointerEvent (Closed)
Patch Set: pointer id Created 3 years, 10 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 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 <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 params.type, gfx::Point(), modifiers_.GetModifierFlags(), touch_id, 339 params.type, gfx::Point(), modifiers_.GetModifierFlags(), touch_id,
340 params.timestamp, /* radius_x */ 0.f, /* radius_y */ 0.f, 340 params.timestamp, /* radius_x */ 0.f, /* radius_y */ 0.f,
341 /* angle */ 0.f, /* force */ 0.f); 341 /* angle */ 0.f, /* force */ 0.f);
342 touch_event.set_location_f(location); 342 touch_event.set_location_f(location);
343 touch_event.set_root_location_f(location); 343 touch_event.set_root_location_f(location);
344 touch_event.set_source_device_id(params.device_id); 344 touch_event.set_source_device_id(params.device_id);
345 touch_event.set_pointer_details(details); 345 touch_event.set_pointer_details(details);
346 DispatchUiEvent(&touch_event); 346 DispatchUiEvent(&touch_event);
347 347
348 if (params.type == ET_TOUCH_RELEASED || params.type == ET_TOUCH_CANCELLED) { 348 if (params.type == ET_TOUCH_RELEASED || params.type == ET_TOUCH_CANCELLED) {
349 touch_id_generator_.ReleaseGeneratedID(touch_event.touch_id()); 349 touch_id_generator_.ReleaseGeneratedID(touch_event.pointer_details().id);
350 } 350 }
351 } 351 }
352 352
353 void EventFactoryEvdev::DispatchUiEvent(Event* event) { 353 void EventFactoryEvdev::DispatchUiEvent(Event* event) {
354 // DispatchEvent takes PlatformEvent which is void*. This function 354 // DispatchEvent takes PlatformEvent which is void*. This function
355 // wraps it with the real type. 355 // wraps it with the real type.
356 DispatchEvent(event); 356 DispatchEvent(event);
357 } 357 }
358 358
359 void EventFactoryEvdev::DispatchKeyboardDevicesUpdated( 359 void EventFactoryEvdev::DispatchKeyboardDevicesUpdated(
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 469
470 // Scan & monitor devices. 470 // Scan & monitor devices.
471 device_manager_->AddObserver(this); 471 device_manager_->AddObserver(this);
472 device_manager_->ScanDevices(this); 472 device_manager_->ScanDevices(this);
473 473
474 // Notify device thread that initial scan is done. 474 // Notify device thread that initial scan is done.
475 input_device_factory_proxy_->OnStartupScanComplete(); 475 input_device_factory_proxy_->OnStartupScanComplete();
476 } 476 }
477 477
478 } // namespace ui 478 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698