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_proxy.h" | 5 #include "content/renderer/input/input_handler_proxy.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 | 210 |
211 InputHandlerProxy::EventDisposition | 211 InputHandlerProxy::EventDisposition |
212 InputHandlerProxy::HandleInputEventWithLatencyInfo( | 212 InputHandlerProxy::HandleInputEventWithLatencyInfo( |
213 const WebInputEvent& event, | 213 const WebInputEvent& event, |
214 ui::LatencyInfo* latency_info) { | 214 ui::LatencyInfo* latency_info) { |
215 DCHECK(input_handler_); | 215 DCHECK(input_handler_); |
216 | 216 |
217 if (uma_latency_reporting_enabled_) | 217 if (uma_latency_reporting_enabled_) |
218 ReportInputEventLatencyUma(event, *latency_info); | 218 ReportInputEventLatencyUma(event, *latency_info); |
219 | 219 |
220 TRACE_EVENT_FLOW_STEP0("input", | 220 TRACE_EVENT_FLOW_STEP0("input,benchmark", |
221 "LatencyInfo.Flow", | 221 "LatencyInfo.Flow", |
222 TRACE_ID_DONT_MANGLE(latency_info->trace_id), | 222 TRACE_ID_DONT_MANGLE(latency_info->trace_id), |
223 "HandleInputEventImpl"); | 223 "HandleInputEventImpl"); |
224 | 224 |
225 scoped_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor = | 225 scoped_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor = |
226 input_handler_->CreateLatencyInfoSwapPromiseMonitor(latency_info); | 226 input_handler_->CreateLatencyInfoSwapPromiseMonitor(latency_info); |
227 InputHandlerProxy::EventDisposition disposition = HandleInputEvent(event); | 227 InputHandlerProxy::EventDisposition disposition = HandleInputEvent(event); |
228 return disposition; | 228 return disposition; |
229 } | 229 } |
230 | 230 |
231 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleInputEvent( | 231 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleInputEvent( |
232 const WebInputEvent& event) { | 232 const WebInputEvent& event) { |
233 DCHECK(input_handler_); | 233 DCHECK(input_handler_); |
234 TRACE_EVENT1("input", "InputHandlerProxy::HandleInputEvent", | 234 TRACE_EVENT1("input,benchmark", "InputHandlerProxy::HandleInputEvent", |
235 "type", WebInputEventTraits::GetName(event.type)); | 235 "type", WebInputEventTraits::GetName(event.type)); |
236 | 236 |
237 client_->DidReceiveInputEvent(event.type); | 237 client_->DidReceiveInputEvent(event.type); |
238 if (FilterInputEventForFlingBoosting(event)) | 238 if (FilterInputEventForFlingBoosting(event)) |
239 return DID_HANDLE; | 239 return DID_HANDLE; |
240 | 240 |
241 switch (event.type) { | 241 switch (event.type) { |
242 case WebInputEvent::MouseWheel: | 242 case WebInputEvent::MouseWheel: |
243 return HandleMouseWheel(static_cast<const WebMouseWheelEvent&>(event)); | 243 return HandleMouseWheel(static_cast<const WebMouseWheelEvent&>(event)); |
244 | 244 |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 // trigger a scroll, e.g., with a trivial time delta between fling updates. | 924 // trigger a scroll, e.g., with a trivial time delta between fling updates. |
925 // Return true in this case to prevent early fling termination. | 925 // Return true in this case to prevent early fling termination. |
926 if (std::abs(clipped_increment.width) < kScrollEpsilon && | 926 if (std::abs(clipped_increment.width) < kScrollEpsilon && |
927 std::abs(clipped_increment.height) < kScrollEpsilon) | 927 std::abs(clipped_increment.height) < kScrollEpsilon) |
928 return true; | 928 return true; |
929 | 929 |
930 return did_scroll; | 930 return did_scroll; |
931 } | 931 } |
932 | 932 |
933 } // namespace content | 933 } // namespace content |
OLD | NEW |