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/browser/renderer_host/input/input_router_impl.h" | 5 #include "content/browser/renderer_host/input/input_router_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 } else { | 143 } else { |
144 coalesced_mouse_wheel_events_.back().event.CoalesceWith( | 144 coalesced_mouse_wheel_events_.back().event.CoalesceWith( |
145 wheel_event.event); | 145 wheel_event.event); |
146 } | 146 } |
147 return; | 147 return; |
148 } | 148 } |
149 | 149 |
150 mouse_wheel_pending_ = true; | 150 mouse_wheel_pending_ = true; |
151 current_wheel_event_ = wheel_event; | 151 current_wheel_event_ = wheel_event; |
152 | 152 |
153 HISTOGRAM_COUNTS_100("Renderer.WheelQueueSize", | 153 LOCAL_HISTOGRAM_COUNTS_100("Renderer.WheelQueueSize", |
154 coalesced_mouse_wheel_events_.size()); | 154 coalesced_mouse_wheel_events_.size()); |
155 | 155 |
156 FilterAndSendWebInputEvent( | 156 FilterAndSendWebInputEvent( |
157 wheel_event.event.event, wheel_event.event.latency, false); | 157 wheel_event.event.event, wheel_event.event.latency, false); |
158 } | 158 } |
159 | 159 |
160 void InputRouterImpl::SendKeyboardEvent(const NativeWebKeyboardEvent& key_event, | 160 void InputRouterImpl::SendKeyboardEvent(const NativeWebKeyboardEvent& key_event, |
161 const ui::LatencyInfo& latency_info, | 161 const ui::LatencyInfo& latency_info, |
162 bool is_keyboard_shortcut) { | 162 bool is_keyboard_shortcut) { |
163 // Put all WebKeyboardEvent objects in a queue since we can't trust the | 163 // Put all WebKeyboardEvent objects in a queue since we can't trust the |
164 // renderer and we need to give something to the HandleKeyboardEvent | 164 // renderer and we need to give something to the HandleKeyboardEvent |
165 // handler. | 165 // handler. |
166 key_queue_.push_back(key_event); | 166 key_queue_.push_back(key_event); |
167 HISTOGRAM_COUNTS_100("Renderer.KeyboardQueueSize", key_queue_.size()); | 167 LOCAL_HISTOGRAM_COUNTS_100("Renderer.KeyboardQueueSize", key_queue_.size()); |
168 | 168 |
169 gesture_event_queue_.FlingHasBeenHalted(); | 169 gesture_event_queue_.FlingHasBeenHalted(); |
170 | 170 |
171 // Only forward the non-native portions of our event. | 171 // Only forward the non-native portions of our event. |
172 FilterAndSendWebInputEvent(key_event, latency_info, is_keyboard_shortcut); | 172 FilterAndSendWebInputEvent(key_event, latency_info, is_keyboard_shortcut); |
173 } | 173 } |
174 | 174 |
175 void InputRouterImpl::SendGestureEvent( | 175 void InputRouterImpl::SendGestureEvent( |
176 const GestureEventWithLatencyInfo& original_gesture_event) { | 176 const GestureEventWithLatencyInfo& original_gesture_event) { |
177 input_stream_validator_.Validate(original_gesture_event.event); | 177 input_stream_validator_.Validate(original_gesture_event.event); |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 InputRouterImpl::QueuedWheelEvent::QueuedWheelEvent( | 690 InputRouterImpl::QueuedWheelEvent::QueuedWheelEvent( |
691 const MouseWheelEventWithLatencyInfo& event, | 691 const MouseWheelEventWithLatencyInfo& event, |
692 bool synthesized_from_pinch) | 692 bool synthesized_from_pinch) |
693 : event(event), synthesized_from_pinch(synthesized_from_pinch) { | 693 : event(event), synthesized_from_pinch(synthesized_from_pinch) { |
694 } | 694 } |
695 | 695 |
696 InputRouterImpl::QueuedWheelEvent::~QueuedWheelEvent() { | 696 InputRouterImpl::QueuedWheelEvent::~QueuedWheelEvent() { |
697 } | 697 } |
698 | 698 |
699 } // namespace content | 699 } // namespace content |
OLD | NEW |