| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "public/platform/WebMouseEvent.h" | 5 #include "public/platform/WebMouseEvent.h" |
| 6 | 6 |
| 7 #include "public/platform/WebGestureEvent.h" | 7 #include "public/platform/WebGestureEvent.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| 11 WebMouseEvent::WebMouseEvent(WebInputEvent::Type type, | 11 WebMouseEvent::WebMouseEvent(WebInputEvent::Type type, |
| 12 const WebGestureEvent& gesture_event, | 12 const WebGestureEvent& gesture_event, |
| 13 Button button_param, | 13 Button button_param, |
| 14 int click_count_param, | 14 int click_count_param, |
| 15 int modifiers, | 15 int modifiers, |
| 16 double time_stamp_seconds) | 16 double time_stamp_seconds, |
| 17 int id_param) |
| 17 : WebInputEvent(sizeof(WebMouseEvent), type, modifiers, time_stamp_seconds), | 18 : WebInputEvent(sizeof(WebMouseEvent), type, modifiers, time_stamp_seconds), |
| 18 WebPointerProperties(button_param, | 19 WebPointerProperties(id_param, |
| 20 button_param, |
| 19 WebPointerProperties::PointerType::kMouse), | 21 WebPointerProperties::PointerType::kMouse), |
| 20 click_count(click_count_param), | 22 click_count(click_count_param), |
| 21 position_in_widget_(gesture_event.x, gesture_event.y), | 23 position_in_widget_(gesture_event.x, gesture_event.y), |
| 22 position_in_screen_(gesture_event.global_x, gesture_event.global_y) { | 24 position_in_screen_(gesture_event.global_x, gesture_event.global_y) { |
| 23 SetFrameScale(gesture_event.FrameScale()); | 25 SetFrameScale(gesture_event.FrameScale()); |
| 24 SetFrameTranslate(gesture_event.FrameTranslate()); | 26 SetFrameTranslate(gesture_event.FrameTranslate()); |
| 25 } | 27 } |
| 26 | 28 |
| 27 WebFloatPoint WebMouseEvent::MovementInRootFrame() const { | 29 WebFloatPoint WebMouseEvent::MovementInRootFrame() const { |
| 28 return WebFloatPoint((movement_x / frame_scale_), | 30 return WebFloatPoint((movement_x / frame_scale_), |
| (...skipping 16 matching lines...) Expand all Loading... |
| 45 position_in_widget_.x = | 47 position_in_widget_.x = |
| 46 floor((position_in_widget_.x / frame_scale_) + frame_translate_.x); | 48 floor((position_in_widget_.x / frame_scale_) + frame_translate_.x); |
| 47 position_in_widget_.y = | 49 position_in_widget_.y = |
| 48 floor((position_in_widget_.y / frame_scale_) + frame_translate_.y); | 50 floor((position_in_widget_.y / frame_scale_) + frame_translate_.y); |
| 49 frame_translate_.x = 0; | 51 frame_translate_.x = 0; |
| 50 frame_translate_.y = 0; | 52 frame_translate_.y = 0; |
| 51 frame_scale_ = 1; | 53 frame_scale_ = 1; |
| 52 } | 54 } |
| 53 | 55 |
| 54 } // namespace blink | 56 } // namespace blink |
| OLD | NEW |