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

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

Issue 755403006: Added experimental Touch.tilt, Touch.tiltDirection support for Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused code (event_sender.cc) Created 5 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
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 "content/browser/renderer_host/input/motion_event_web.h" 7 #include "content/browser/renderer_host/input/motion_event_web.h"
8 #include "content/browser/renderer_host/input/web_input_event_util.h" 8 #include "content/browser/renderer_host/input/web_input_event_util.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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 touch_event_.modifiers = mouse_event.modifiers; 430 touch_event_.modifiers = mouse_event.modifiers;
431 WebTouchEventTraits::ResetTypeAndTouchStates( 431 WebTouchEventTraits::ResetTypeAndTouchStates(
432 eventType, mouse_event.timeStampSeconds, &touch_event_); 432 eventType, mouse_event.timeStampSeconds, &touch_event_);
433 433
434 WebTouchPoint& point = touch_event_.touches[0]; 434 WebTouchPoint& point = touch_event_.touches[0];
435 point.id = 0; 435 point.id = 0;
436 point.radiusX = 0.5f * cursor_size_.width(); 436 point.radiusX = 0.5f * cursor_size_.width();
437 point.radiusY = 0.5f * cursor_size_.height(); 437 point.radiusY = 0.5f * cursor_size_.height();
438 point.force = 1.f; 438 point.force = 1.f;
439 point.rotationAngle = 0.f; 439 point.rotationAngle = 0.f;
440 point.tilt = 0.f;
441 point.tiltDirection = 0.f;
440 point.position.x = mouse_event.x; 442 point.position.x = mouse_event.x;
441 point.screenPosition.x = mouse_event.globalX; 443 point.screenPosition.x = mouse_event.globalX;
442 point.position.y = mouse_event.y; 444 point.position.y = mouse_event.y;
443 point.screenPosition.y = mouse_event.globalY; 445 point.screenPosition.y = mouse_event.globalY;
444 } 446 }
445 447
446 bool TouchEmulator::InPinchGestureMode() const { 448 bool TouchEmulator::InPinchGestureMode() const {
447 return shift_pressed_; 449 return shift_pressed_;
448 } 450 }
449 451
450 } // namespace content 452 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/input/motion_event_web.cc ('k') | content/browser/renderer_host/input/web_input_event_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698