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

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

Issue 2720133002: Make pinch zoom work on chromeos by setting touch id correctly (Closed)
Patch Set: pinch zoom Created 3 years, 9 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
« no previous file with comments | « ui/events/event_unittest.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/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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 void EventFactoryEvdev::DispatchTouchEvent(const TouchEventParams& params) { 328 void EventFactoryEvdev::DispatchTouchEvent(const TouchEventParams& params) {
329 TRACE_EVENT1("evdev", "EventFactoryEvdev::DispatchTouchEvent", "device", 329 TRACE_EVENT1("evdev", "EventFactoryEvdev::DispatchTouchEvent", "device",
330 params.device_id); 330 params.device_id);
331 331
332 gfx::PointF location = GetTransformedEventLocation(params); 332 gfx::PointF location = GetTransformedEventLocation(params);
333 PointerDetails details = GetTransformedEventPointerDetails(params); 333 PointerDetails details = GetTransformedEventPointerDetails(params);
334 334
335 // params.slot is guaranteed to be < kNumTouchEvdevSlots. 335 // params.slot is guaranteed to be < kNumTouchEvdevSlots.
336 int touch_id = touch_id_generator_.GetGeneratedID( 336 int touch_id = touch_id_generator_.GetGeneratedID(
337 params.device_id * kNumTouchEvdevSlots + params.slot); 337 params.device_id * kNumTouchEvdevSlots + params.slot);
338 details.id = touch_id;
338 TouchEvent touch_event( 339 TouchEvent touch_event(
339 params.type, gfx::Point(), modifiers_.GetModifierFlags(), touch_id, 340 params.type, gfx::Point(), modifiers_.GetModifierFlags(), touch_id,
340 params.timestamp, /* radius_x */ 0.f, /* radius_y */ 0.f, 341 params.timestamp, /* radius_x */ 0.f, /* radius_y */ 0.f,
341 /* angle */ 0.f, /* force */ 0.f); 342 /* angle */ 0.f, /* force */ 0.f);
342 touch_event.set_location_f(location); 343 touch_event.set_location_f(location);
343 touch_event.set_root_location_f(location); 344 touch_event.set_root_location_f(location);
344 touch_event.set_source_device_id(params.device_id); 345 touch_event.set_source_device_id(params.device_id);
345 touch_event.set_pointer_details(details); 346 touch_event.set_pointer_details(details);
346 DispatchUiEvent(&touch_event); 347 DispatchUiEvent(&touch_event);
347 348
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 470
470 // Scan & monitor devices. 471 // Scan & monitor devices.
471 device_manager_->AddObserver(this); 472 device_manager_->AddObserver(this);
472 device_manager_->ScanDevices(this); 473 device_manager_->ScanDevices(this);
473 474
474 // Notify device thread that initial scan is done. 475 // Notify device thread that initial scan is done.
475 input_device_factory_proxy_->OnStartupScanComplete(); 476 input_device_factory_proxy_->OnStartupScanComplete();
476 } 477 }
477 478
478 } // namespace ui 479 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/event_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698