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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 DCHECK(input_handler_); | 99 DCHECK(input_handler_); |
100 | 100 |
101 if (event.type == WebInputEvent::MouseWheel) { | 101 if (event.type == WebInputEvent::MouseWheel) { |
102 const WebMouseWheelEvent& wheel_event = | 102 const WebMouseWheelEvent& wheel_event = |
103 *static_cast<const WebMouseWheelEvent*>(&event); | 103 *static_cast<const WebMouseWheelEvent*>(&event); |
104 if (wheel_event.scrollByPage) { | 104 if (wheel_event.scrollByPage) { |
105 // TODO(jamesr): We don't properly handle scroll by page in the compositor | 105 // TODO(jamesr): We don't properly handle scroll by page in the compositor |
106 // thread, so punt it to the main thread. http://crbug.com/236639 | 106 // thread, so punt it to the main thread. http://crbug.com/236639 |
107 return DID_NOT_HANDLE; | 107 return DID_NOT_HANDLE; |
108 } | 108 } |
| 109 TRACE_EVENT0( |
| 110 "impl-scroll", |
| 111 "InputHandlerProxy::HandleInputEvent wheel scroll"); |
109 cc::InputHandler::ScrollStatus scroll_status = input_handler_->ScrollBegin( | 112 cc::InputHandler::ScrollStatus scroll_status = input_handler_->ScrollBegin( |
110 gfx::Point(wheel_event.x, wheel_event.y), cc::InputHandler::Wheel); | 113 gfx::Point(wheel_event.x, wheel_event.y), cc::InputHandler::Wheel); |
111 switch (scroll_status) { | 114 switch (scroll_status) { |
112 case cc::InputHandler::ScrollStarted: { | 115 case cc::InputHandler::ScrollStarted: { |
113 TRACE_EVENT_INSTANT2( | 116 TRACE_EVENT_INSTANT2( |
114 "renderer", | 117 "renderer", |
115 "InputHandlerProxy::handle_input wheel scroll", | 118 "InputHandlerProxy::handle_input wheel scroll", |
116 TRACE_EVENT_SCOPE_THREAD, | 119 TRACE_EVENT_SCOPE_THREAD, |
117 "deltaX", | 120 "deltaX", |
118 -wheel_event.deltaX, | 121 -wheel_event.deltaX, |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 TRACE_EVENT2("renderer", | 449 TRACE_EVENT2("renderer", |
447 "InputHandlerProxy::notifyCurrentFlingVelocity", | 450 "InputHandlerProxy::notifyCurrentFlingVelocity", |
448 "vx", | 451 "vx", |
449 velocity.width, | 452 velocity.width, |
450 "vy", | 453 "vy", |
451 velocity.height); | 454 velocity.height); |
452 input_handler_->NotifyCurrentFlingVelocity(ToClientScrollIncrement(velocity)); | 455 input_handler_->NotifyCurrentFlingVelocity(ToClientScrollIncrement(velocity)); |
453 } | 456 } |
454 | 457 |
455 } // namespace content | 458 } // namespace content |
OLD | NEW |