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

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

Issue 1218663006: Use new WebTouchPoint field names. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 default: 431 default:
432 eventType = WebInputEvent::Undefined; 432 eventType = WebInputEvent::Undefined;
433 NOTREACHED() << "Invalid event for touch emulation: " << mouse_event.type; 433 NOTREACHED() << "Invalid event for touch emulation: " << mouse_event.type;
434 } 434 }
435 touch_event_.touchesLength = 1; 435 touch_event_.touchesLength = 1;
436 touch_event_.modifiers = mouse_event.modifiers; 436 touch_event_.modifiers = mouse_event.modifiers;
437 WebTouchEventTraits::ResetTypeAndTouchStates( 437 WebTouchEventTraits::ResetTypeAndTouchStates(
438 eventType, mouse_event.timeStampSeconds, &touch_event_); 438 eventType, mouse_event.timeStampSeconds, &touch_event_);
439 439
440 WebTouchPoint& point = touch_event_.touches[0]; 440 WebTouchPoint& point = touch_event_.touches[0];
441 point.id = 0; 441 point.pointerId = 0;
442 point.radiusX = 0.5f * cursor_size_.width(); 442 point.width = 0.5f * cursor_size_.width();
443 point.radiusY = 0.5f * cursor_size_.height(); 443 point.height = 0.5f * cursor_size_.height();
444 point.force = 1.f; 444 point.pressure = 1.f;
445 point.rotationAngle = 0.f; 445 point.rotationAngle = 0.f;
446 point.position.x = mouse_event.x; 446 point.position.x = mouse_event.x;
447 point.screenPosition.x = mouse_event.globalX; 447 point.screenPosition.x = mouse_event.globalX;
448 point.position.y = mouse_event.y; 448 point.position.y = mouse_event.y;
449 point.screenPosition.y = mouse_event.globalY; 449 point.screenPosition.y = mouse_event.globalY;
450 } 450 }
451 451
452 bool TouchEmulator::InPinchGestureMode() const { 452 bool TouchEmulator::InPinchGestureMode() const {
453 return shift_pressed_; 453 return shift_pressed_;
454 } 454 }
455 455
456 } // namespace content 456 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698