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

Side by Side Diff: content/browser/renderer_host/input/touch_emulator.cc

Issue 2700623003: Make sure that the pressure is always 0 for pointerup events (Closed)
Patch Set: pressure 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
« no previous file with comments | « no previous file | content/common/input/synthetic_web_input_event_builders.cc » ('j') | 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 "content/browser/renderer_host/input/touch_emulator.h" 5 #include "content/browser/renderer_host/input/touch_emulator.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "content/browser/renderer_host/input/motion_event_web.h" 8 #include "content/browser/renderer_host/input/motion_event_web.h"
9 #include "content/common/input/web_touch_event_traits.h" 9 #include "content/common/input/web_touch_event_traits.h"
10 #include "content/grit/content_resources.h" 10 #include "content/grit/content_resources.h"
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 << mouse_event.type(); 454 << mouse_event.type();
455 } 455 }
456 touch_event_.touchesLength = 1; 456 touch_event_.touchesLength = 1;
457 touch_event_.setModifiers(ModifiersWithoutMouseButtons(mouse_event)); 457 touch_event_.setModifiers(ModifiersWithoutMouseButtons(mouse_event));
458 WebTouchEventTraits::ResetTypeAndTouchStates( 458 WebTouchEventTraits::ResetTypeAndTouchStates(
459 eventType, mouse_event.timeStampSeconds(), &touch_event_); 459 eventType, mouse_event.timeStampSeconds(), &touch_event_);
460 WebTouchPoint& point = touch_event_.touches[0]; 460 WebTouchPoint& point = touch_event_.touches[0];
461 point.id = 0; 461 point.id = 0;
462 point.radiusX = 0.5f * cursor_size_.width(); 462 point.radiusX = 0.5f * cursor_size_.width();
463 point.radiusY = 0.5f * cursor_size_.height(); 463 point.radiusY = 0.5f * cursor_size_.height();
464 point.force = 1.f; 464 point.force = eventType == WebInputEvent::TouchEnd ? 0.f : 1.f;
465 point.rotationAngle = 0.f; 465 point.rotationAngle = 0.f;
466 point.position.x = mouse_event.x; 466 point.position.x = mouse_event.x;
467 point.screenPosition.x = mouse_event.globalX; 467 point.screenPosition.x = mouse_event.globalX;
468 point.position.y = mouse_event.y; 468 point.position.y = mouse_event.y;
469 point.screenPosition.y = mouse_event.globalY; 469 point.screenPosition.y = mouse_event.globalY;
470 point.tiltX = 0; 470 point.tiltX = 0;
471 point.tiltY = 0; 471 point.tiltY = 0;
472 point.pointerType = blink::WebPointerProperties::PointerType::Touch; 472 point.pointerType = blink::WebPointerProperties::PointerType::Touch;
473 } 473 }
474 474
475 bool TouchEmulator::InPinchGestureMode() const { 475 bool TouchEmulator::InPinchGestureMode() const {
476 return shift_pressed_; 476 return shift_pressed_;
477 } 477 }
478 478
479 } // namespace content 479 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/input/synthetic_web_input_event_builders.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698