| 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/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 InputHandlerProxy::EventDisposition disposition = HandleInputEvent(event); | 226 InputHandlerProxy::EventDisposition disposition = HandleInputEvent(event); |
| 227 return disposition; | 227 return disposition; |
| 228 } | 228 } |
| 229 | 229 |
| 230 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleInputEvent( | 230 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleInputEvent( |
| 231 const WebInputEvent& event) { | 231 const WebInputEvent& event) { |
| 232 DCHECK(input_handler_); | 232 DCHECK(input_handler_); |
| 233 TRACE_EVENT1("input,benchmark", "InputHandlerProxy::HandleInputEvent", | 233 TRACE_EVENT1("input,benchmark", "InputHandlerProxy::HandleInputEvent", |
| 234 "type", WebInputEventTraits::GetName(event.type)); | 234 "type", WebInputEventTraits::GetName(event.type)); |
| 235 | 235 |
| 236 client_->DidReceiveInputEvent(event.type); | 236 client_->DidReceiveInputEvent(event); |
| 237 if (FilterInputEventForFlingBoosting(event)) | 237 if (FilterInputEventForFlingBoosting(event)) |
| 238 return DID_HANDLE; | 238 return DID_HANDLE; |
| 239 | 239 |
| 240 switch (event.type) { | 240 switch (event.type) { |
| 241 case WebInputEvent::MouseWheel: | 241 case WebInputEvent::MouseWheel: |
| 242 return HandleMouseWheel(static_cast<const WebMouseWheelEvent&>(event)); | 242 return HandleMouseWheel(static_cast<const WebMouseWheelEvent&>(event)); |
| 243 | 243 |
| 244 case WebInputEvent::GestureScrollBegin: | 244 case WebInputEvent::GestureScrollBegin: |
| 245 return HandleGestureScrollBegin( | 245 return HandleGestureScrollBegin( |
| 246 static_cast<const WebGestureEvent&>(event)); | 246 static_cast<const WebGestureEvent&>(event)); |
| (...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 942 // trigger a scroll, e.g., with a trivial time delta between fling updates. | 942 // trigger a scroll, e.g., with a trivial time delta between fling updates. |
| 943 // Return true in this case to prevent early fling termination. | 943 // Return true in this case to prevent early fling termination. |
| 944 if (std::abs(clipped_increment.width) < kScrollEpsilon && | 944 if (std::abs(clipped_increment.width) < kScrollEpsilon && |
| 945 std::abs(clipped_increment.height) < kScrollEpsilon) | 945 std::abs(clipped_increment.height) < kScrollEpsilon) |
| 946 return true; | 946 return true; |
| 947 | 947 |
| 948 return did_scroll; | 948 return did_scroll; |
| 949 } | 949 } |
| 950 | 950 |
| 951 } // namespace content | 951 } // namespace content |
| OLD | NEW |