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

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: Created 6 years 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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 touch_event_.modifiers = mouse_event.modifiers; 419 touch_event_.modifiers = mouse_event.modifiers;
420 WebTouchEventTraits::ResetTypeAndTouchStates( 420 WebTouchEventTraits::ResetTypeAndTouchStates(
421 eventType, mouse_event.timeStampSeconds, &touch_event_); 421 eventType, mouse_event.timeStampSeconds, &touch_event_);
422 422
423 WebTouchPoint& point = touch_event_.touches[0]; 423 WebTouchPoint& point = touch_event_.touches[0];
424 point.id = 0; 424 point.id = 0;
425 point.radiusX = 0.5f * cursor_size_.width(); 425 point.radiusX = 0.5f * cursor_size_.width();
426 point.radiusY = 0.5f * cursor_size_.height(); 426 point.radiusY = 0.5f * cursor_size_.height();
427 point.force = 1.f; 427 point.force = 1.f;
428 point.rotationAngle = 0.f; 428 point.rotationAngle = 0.f;
429 point.tilt = 0.f;
429 point.position.x = mouse_event.x; 430 point.position.x = mouse_event.x;
430 point.screenPosition.x = mouse_event.globalX; 431 point.screenPosition.x = mouse_event.globalX;
431 point.position.y = mouse_event.y; 432 point.position.y = mouse_event.y;
432 point.screenPosition.y = mouse_event.globalY; 433 point.screenPosition.y = mouse_event.globalY;
433 434
434 return true; 435 return true;
435 } 436 }
436 437
437 bool TouchEmulator::InPinchGestureMode() const { 438 bool TouchEmulator::InPinchGestureMode() const {
438 return shift_pressed_; 439 return shift_pressed_;
439 } 440 }
440 441
441 } // namespace content 442 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698