| 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/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 } | 167 } |
| 168 | 168 |
| 169 InputHandlerProxy::EventDisposition | 169 InputHandlerProxy::EventDisposition |
| 170 InputHandlerProxy::HandleInputEventWithLatencyInfo( | 170 InputHandlerProxy::HandleInputEventWithLatencyInfo( |
| 171 const WebInputEvent& event, | 171 const WebInputEvent& event, |
| 172 ui::LatencyInfo* latency_info) { | 172 ui::LatencyInfo* latency_info) { |
| 173 DCHECK(input_handler_); | 173 DCHECK(input_handler_); |
| 174 | 174 |
| 175 SendScrollLatencyUma(event, *latency_info); | 175 SendScrollLatencyUma(event, *latency_info); |
| 176 | 176 |
| 177 TRACE_EVENT_FLOW_STEP0( | 177 TRACE_EVENT_FLOW_STEP0("input", |
| 178 "input", | 178 "LatencyInfo.Flow", |
| 179 "LatencyInfo.Flow", | 179 TRACE_ID_DONT_MANGLE(latency_info->trace_id), |
| 180 TRACE_ID_DONT_MANGLE(latency_info->trace_id), | 180 "HandleInputEventImpl"); |
| 181 "HanldeInputEventImpl"); | |
| 182 | 181 |
| 183 scoped_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor = | 182 scoped_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor = |
| 184 input_handler_->CreateLatencyInfoSwapPromiseMonitor(latency_info); | 183 input_handler_->CreateLatencyInfoSwapPromiseMonitor(latency_info); |
| 185 InputHandlerProxy::EventDisposition disposition = HandleInputEvent(event); | 184 InputHandlerProxy::EventDisposition disposition = HandleInputEvent(event); |
| 186 return disposition; | 185 return disposition; |
| 187 } | 186 } |
| 188 | 187 |
| 189 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleInputEvent( | 188 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleInputEvent( |
| 190 const WebInputEvent& event) { | 189 const WebInputEvent& event) { |
| 191 DCHECK(input_handler_); | 190 DCHECK(input_handler_); |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 // trigger a scroll, e.g., with a trivial time delta between fling updates. | 784 // trigger a scroll, e.g., with a trivial time delta between fling updates. |
| 786 // Return true in this case to prevent early fling termination. | 785 // Return true in this case to prevent early fling termination. |
| 787 if (std::abs(clipped_increment.width) < kScrollEpsilon && | 786 if (std::abs(clipped_increment.width) < kScrollEpsilon && |
| 788 std::abs(clipped_increment.height) < kScrollEpsilon) | 787 std::abs(clipped_increment.height) < kScrollEpsilon) |
| 789 return true; | 788 return true; |
| 790 | 789 |
| 791 return did_scroll; | 790 return did_scroll; |
| 792 } | 791 } |
| 793 | 792 |
| 794 } // namespace content | 793 } // namespace content |
| OLD | NEW |