Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Side by Side Diff: content/renderer/input/input_handler_proxy.cc

Issue 177213016: Give blink a chance to consume ctrl+wheel events before zooming (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with trunk (no changes) Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 (wheel_event.modifiers & WebInputEvent::ControlKey) {
119 // Wheel events involving the control key never trigger scrolling, only
120 // event handlers. Forward to the main thread.
121 return DID_NOT_HANDLE;
122 }
118 cc::InputHandler::ScrollStatus scroll_status = input_handler_->ScrollBegin( 123 cc::InputHandler::ScrollStatus scroll_status = input_handler_->ScrollBegin(
119 gfx::Point(wheel_event.x, wheel_event.y), cc::InputHandler::Wheel); 124 gfx::Point(wheel_event.x, wheel_event.y), cc::InputHandler::Wheel);
120 switch (scroll_status) { 125 switch (scroll_status) {
121 case cc::InputHandler::ScrollStarted: { 126 case cc::InputHandler::ScrollStarted: {
122 TRACE_EVENT_INSTANT2( 127 TRACE_EVENT_INSTANT2(
123 "renderer", 128 "renderer",
124 "InputHandlerProxy::handle_input wheel scroll", 129 "InputHandlerProxy::handle_input wheel scroll",
125 TRACE_EVENT_SCOPE_THREAD, 130 TRACE_EVENT_SCOPE_THREAD,
126 "deltaX", 131 "deltaX",
127 -wheel_event.deltaX, 132 -wheel_event.deltaX,
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 TRACE_EVENT2("renderer", 486 TRACE_EVENT2("renderer",
482 "InputHandlerProxy::notifyCurrentFlingVelocity", 487 "InputHandlerProxy::notifyCurrentFlingVelocity",
483 "vx", 488 "vx",
484 velocity.width, 489 velocity.width,
485 "vy", 490 "vy",
486 velocity.height); 491 velocity.height);
487 input_handler_->NotifyCurrentFlingVelocity(ToClientScrollIncrement(velocity)); 492 input_handler_->NotifyCurrentFlingVelocity(ToClientScrollIncrement(velocity));
488 } 493 }
489 494
490 } // namespace content 495 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl_unittest.cc ('k') | content/renderer/input/input_handler_proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698