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/renderer/input/input_handler_wrapper.h" | 5 #include "content/renderer/input/input_handler_wrapper.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "content/public/common/content_features.h" | 9 #include "content/public/common/content_features.h" |
10 #include "content/public/common/content_switches.h" | 10 #include "content/public/common/content_switches.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 } | 83 } |
84 | 84 |
85 void InputHandlerWrapper::DidStopFlinging() { | 85 void InputHandlerWrapper::DidStopFlinging() { |
86 input_handler_manager_->DidStopFlinging(routing_id_); | 86 input_handler_manager_->DidStopFlinging(routing_id_); |
87 } | 87 } |
88 | 88 |
89 void InputHandlerWrapper::DidAnimateForInput() { | 89 void InputHandlerWrapper::DidAnimateForInput() { |
90 input_handler_manager_->DidAnimateForInput(); | 90 input_handler_manager_->DidAnimateForInput(); |
91 } | 91 } |
92 | 92 |
| 93 void InputHandlerWrapper::GenerateScrollBeginAndSendToMainThread( |
| 94 const blink::WebGestureEvent& update_event) { |
| 95 DCHECK_EQ(update_event.GetType(), blink::WebInputEvent::kGestureScrollUpdate); |
| 96 blink::WebGestureEvent scroll_begin(update_event); |
| 97 scroll_begin.SetType(blink::WebInputEvent::kGestureScrollBegin); |
| 98 scroll_begin.data.scroll_begin.inertial_phase = |
| 99 update_event.data.scroll_update.inertial_phase; |
| 100 scroll_begin.data.scroll_begin.delta_x_hint = |
| 101 update_event.data.scroll_update.delta_x; |
| 102 scroll_begin.data.scroll_begin.delta_y_hint = |
| 103 update_event.data.scroll_update.delta_y; |
| 104 scroll_begin.data.scroll_begin.delta_hint_units = |
| 105 update_event.data.scroll_update.delta_units; |
| 106 |
| 107 DispatchNonBlockingEventToMainThread( |
| 108 ui::WebInputEventTraits::Clone(scroll_begin), ui::LatencyInfo()); |
| 109 } |
| 110 |
93 } // namespace content | 111 } // namespace content |
OLD | NEW |