| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/gpu/input_handler_proxy.h" | 5 #include "content/renderer/gpu/input_handler_proxy.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "content/renderer/gpu/input_handler_proxy_client.h" | 10 #include "content/renderer/gpu/input_handler_proxy_client.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 DCHECK(input_handler_); | 96 DCHECK(input_handler_); |
| 97 | 97 |
| 98 if (event.type == WebInputEvent::MouseWheel) { | 98 if (event.type == WebInputEvent::MouseWheel) { |
| 99 const WebMouseWheelEvent& wheel_event = | 99 const WebMouseWheelEvent& wheel_event = |
| 100 *static_cast<const WebMouseWheelEvent*>(&event); | 100 *static_cast<const WebMouseWheelEvent*>(&event); |
| 101 if (wheel_event.scrollByPage) { | 101 if (wheel_event.scrollByPage) { |
| 102 // TODO(jamesr): We don't properly handle scroll by page in the compositor | 102 // TODO(jamesr): We don't properly handle scroll by page in the compositor |
| 103 // thread, so punt it to the main thread. http://crbug.com/236639 | 103 // thread, so punt it to the main thread. http://crbug.com/236639 |
| 104 return DID_NOT_HANDLE; | 104 return DID_NOT_HANDLE; |
| 105 } | 105 } |
| 106 TRACE_EVENT0( |
| 107 "impl-scroll", |
| 108 "InputHandlerProxy::HandleInputEvent wheel scroll"); |
| 106 cc::InputHandler::ScrollStatus scroll_status = input_handler_->ScrollBegin( | 109 cc::InputHandler::ScrollStatus scroll_status = input_handler_->ScrollBegin( |
| 107 gfx::Point(wheel_event.x, wheel_event.y), cc::InputHandler::Wheel); | 110 gfx::Point(wheel_event.x, wheel_event.y), cc::InputHandler::Wheel); |
| 108 switch (scroll_status) { | 111 switch (scroll_status) { |
| 109 case cc::InputHandler::ScrollStarted: { | 112 case cc::InputHandler::ScrollStarted: { |
| 110 TRACE_EVENT_INSTANT2( | 113 TRACE_EVENT_INSTANT2( |
| 111 "renderer", | 114 "renderer", |
| 112 "InputHandlerProxy::handle_input wheel scroll", | 115 "InputHandlerProxy::handle_input wheel scroll", |
| 113 TRACE_EVENT_SCOPE_THREAD, | 116 TRACE_EVENT_SCOPE_THREAD, |
| 114 "deltaX", | 117 "deltaX", |
| 115 -wheel_event.deltaX, | 118 -wheel_event.deltaX, |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 TRACE_EVENT2("renderer", | 446 TRACE_EVENT2("renderer", |
| 444 "InputHandlerProxy::notifyCurrentFlingVelocity", | 447 "InputHandlerProxy::notifyCurrentFlingVelocity", |
| 445 "vx", | 448 "vx", |
| 446 velocity.width, | 449 velocity.width, |
| 447 "vy", | 450 "vy", |
| 448 velocity.height); | 451 velocity.height); |
| 449 input_handler_->NotifyCurrentFlingVelocity(ToClientScrollIncrement(velocity)); | 452 input_handler_->NotifyCurrentFlingVelocity(ToClientScrollIncrement(velocity)); |
| 450 } | 453 } |
| 451 | 454 |
| 452 } // namespace content | 455 } // namespace content |
| OLD | NEW |