| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/common/input/synthetic_web_input_event_builders.h" | 5 #include "content/common/input/synthetic_web_input_event_builders.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "content/common/input/web_touch_event_traits.h" | 8 #include "content/common/input/web_touch_event_traits.h" |
| 9 #include "ui/events/base_event_utils.h" | 9 #include "ui/events/base_event_utils.h" |
| 10 #include "ui/events/keycodes/keyboard_codes.h" | 10 #include "ui/events/keycodes/keyboard_codes.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 result.x = x; | 79 result.x = x; |
| 80 result.y = y; | 80 result.y = y; |
| 81 result.deltaX = dx; | 81 result.deltaX = dx; |
| 82 result.deltaY = dy; | 82 result.deltaY = dy; |
| 83 if (dx) | 83 if (dx) |
| 84 result.wheelTicksX = dx > 0.0f ? 1.0f : -1.0f; | 84 result.wheelTicksX = dx > 0.0f ? 1.0f : -1.0f; |
| 85 if (dy) | 85 if (dy) |
| 86 result.wheelTicksY = dy > 0.0f ? 1.0f : -1.0f; | 86 result.wheelTicksY = dy > 0.0f ? 1.0f : -1.0f; |
| 87 result.modifiers = modifiers; | 87 result.modifiers = modifiers; |
| 88 result.hasPreciseScrollingDeltas = precise; | 88 result.hasPreciseScrollingDeltas = precise; |
| 89 result.canScroll = true; | |
| 90 return result; | 89 return result; |
| 91 } | 90 } |
| 92 | 91 |
| 93 WebKeyboardEvent SyntheticWebKeyboardEventBuilder::Build( | 92 WebKeyboardEvent SyntheticWebKeyboardEventBuilder::Build( |
| 94 WebInputEvent::Type type) { | 93 WebInputEvent::Type type) { |
| 95 DCHECK(WebInputEvent::isKeyboardEventType(type)); | 94 DCHECK(WebInputEvent::isKeyboardEventType(type)); |
| 96 WebKeyboardEvent result; | 95 WebKeyboardEvent result; |
| 97 result.type = type; | 96 result.type = type; |
| 98 result.windowsKeyCode = ui::VKEY_L; // non-null made up value. | 97 result.windowsKeyCode = ui::VKEY_L; // non-null made up value. |
| 99 return result; | 98 return result; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 touches[index].state = WebTouchPoint::StateCancelled; | 234 touches[index].state = WebTouchPoint::StateCancelled; |
| 236 WebTouchEventTraits::ResetType( | 235 WebTouchEventTraits::ResetType( |
| 237 WebInputEvent::TouchCancel, timeStampSeconds, this); | 236 WebInputEvent::TouchCancel, timeStampSeconds, this); |
| 238 } | 237 } |
| 239 | 238 |
| 240 void SyntheticWebTouchEvent::SetTimestamp(base::TimeTicks timestamp) { | 239 void SyntheticWebTouchEvent::SetTimestamp(base::TimeTicks timestamp) { |
| 241 timeStampSeconds = ui::EventTimeStampToSeconds(timestamp); | 240 timeStampSeconds = ui::EventTimeStampToSeconds(timestamp); |
| 242 } | 241 } |
| 243 | 242 |
| 244 } // namespace content | 243 } // namespace content |
| OLD | NEW |