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/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/input/input_handler_proxy_client.h" | 10 #include "content/renderer/input/input_handler_proxy_client.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 DCHECK(input_handler_); | 108 DCHECK(input_handler_); |
109 | 109 |
110 if (event.type == WebInputEvent::MouseWheel) { | 110 if (event.type == WebInputEvent::MouseWheel) { |
111 const WebMouseWheelEvent& wheel_event = | 111 const WebMouseWheelEvent& wheel_event = |
112 *static_cast<const WebMouseWheelEvent*>(&event); | 112 *static_cast<const WebMouseWheelEvent*>(&event); |
113 if (wheel_event.scrollByPage) { | 113 if (wheel_event.scrollByPage) { |
114 // TODO(jamesr): We don't properly handle scroll by page in the compositor | 114 // TODO(jamesr): We don't properly handle scroll by page in the compositor |
115 // thread, so punt it to the main thread. http://crbug.com/236639 | 115 // thread, so punt it to the main thread. http://crbug.com/236639 |
116 return DID_NOT_HANDLE; | 116 return DID_NOT_HANDLE; |
117 } | 117 } |
| 118 #if !defined(OS_MACOSX) |
| 119 if (wheel_event.modifiers & WebInputEvent::ControlKey) { |
| 120 // Ctrl + mousewheel changes zoom on every platform except for Mac, |
| 121 // see WebContentsImpl::HandleWheelEvent. |
| 122 return DID_NOT_HANDLE; |
| 123 } |
| 124 #endif |
118 cc::InputHandler::ScrollStatus scroll_status = input_handler_->ScrollBegin( | 125 cc::InputHandler::ScrollStatus scroll_status = input_handler_->ScrollBegin( |
119 gfx::Point(wheel_event.x, wheel_event.y), cc::InputHandler::Wheel); | 126 gfx::Point(wheel_event.x, wheel_event.y), cc::InputHandler::Wheel); |
120 switch (scroll_status) { | 127 switch (scroll_status) { |
121 case cc::InputHandler::ScrollStarted: { | 128 case cc::InputHandler::ScrollStarted: { |
122 TRACE_EVENT_INSTANT2( | 129 TRACE_EVENT_INSTANT2( |
123 "renderer", | 130 "renderer", |
124 "InputHandlerProxy::handle_input wheel scroll", | 131 "InputHandlerProxy::handle_input wheel scroll", |
125 TRACE_EVENT_SCOPE_THREAD, | 132 TRACE_EVENT_SCOPE_THREAD, |
126 "deltaX", | 133 "deltaX", |
127 -wheel_event.deltaX, | 134 -wheel_event.deltaX, |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 TRACE_EVENT2("renderer", | 488 TRACE_EVENT2("renderer", |
482 "InputHandlerProxy::notifyCurrentFlingVelocity", | 489 "InputHandlerProxy::notifyCurrentFlingVelocity", |
483 "vx", | 490 "vx", |
484 velocity.width, | 491 velocity.width, |
485 "vy", | 492 "vy", |
486 velocity.height); | 493 velocity.height); |
487 input_handler_->NotifyCurrentFlingVelocity(ToClientScrollIncrement(velocity)); | 494 input_handler_->NotifyCurrentFlingVelocity(ToClientScrollIncrement(velocity)); |
488 } | 495 } |
489 | 496 |
490 } // namespace content | 497 } // namespace content |
OLD | NEW |