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

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

Issue 819993002: Revert of Explicitly suppress scrolling for wheel events that will trigger zooming (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
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/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 317
318 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleMouseWheel( 318 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleMouseWheel(
319 const WebMouseWheelEvent& wheel_event) { 319 const WebMouseWheelEvent& wheel_event) {
320 InputHandlerProxy::EventDisposition result = DID_NOT_HANDLE; 320 InputHandlerProxy::EventDisposition result = DID_NOT_HANDLE;
321 cc::InputHandlerScrollResult scroll_result; 321 cc::InputHandlerScrollResult scroll_result;
322 322
323 if (wheel_event.scrollByPage) { 323 if (wheel_event.scrollByPage) {
324 // TODO(jamesr): We don't properly handle scroll by page in the compositor 324 // TODO(jamesr): We don't properly handle scroll by page in the compositor
325 // thread, so punt it to the main thread. http://crbug.com/236639 325 // thread, so punt it to the main thread. http://crbug.com/236639
326 result = DID_NOT_HANDLE; 326 result = DID_NOT_HANDLE;
327 } else if (!wheel_event.canScroll) { 327 } else if (wheel_event.modifiers & WebInputEvent::ControlKey) {
328 // Wheel events with |canScroll| == false will not trigger scrolling, 328 // Wheel events involving the control key never trigger scrolling, only
329 // only event handlers. Forward to the main thread. 329 // event handlers. Forward to the main thread.
330 result = DID_NOT_HANDLE; 330 result = DID_NOT_HANDLE;
331 } else if (smooth_scroll_enabled_) { 331 } else if (smooth_scroll_enabled_) {
332 cc::InputHandler::ScrollStatus scroll_status = 332 cc::InputHandler::ScrollStatus scroll_status =
333 input_handler_->ScrollAnimated( 333 input_handler_->ScrollAnimated(
334 gfx::Point(wheel_event.x, wheel_event.y), 334 gfx::Point(wheel_event.x, wheel_event.y),
335 gfx::Vector2dF(-wheel_event.deltaX, -wheel_event.deltaY)); 335 gfx::Vector2dF(-wheel_event.deltaX, -wheel_event.deltaY));
336 switch (scroll_status) { 336 switch (scroll_status) {
337 case cc::InputHandler::ScrollStarted: 337 case cc::InputHandler::ScrollStarted:
338 result = DID_HANDLE; 338 result = DID_HANDLE;
339 break; 339 break;
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 // trigger a scroll, e.g., with a trivial time delta between fling updates. 921 // trigger a scroll, e.g., with a trivial time delta between fling updates.
922 // Return true in this case to prevent early fling termination. 922 // Return true in this case to prevent early fling termination.
923 if (std::abs(clipped_increment.width) < kScrollEpsilon && 923 if (std::abs(clipped_increment.width) < kScrollEpsilon &&
924 std::abs(clipped_increment.height) < kScrollEpsilon) 924 std::abs(clipped_increment.height) < kScrollEpsilon)
925 return true; 925 return true;
926 926
927 return did_scroll; 927 return did_scroll;
928 } 928 }
929 929
930 } // namespace content 930 } // namespace content
OLDNEW
« no previous file with comments | « content/common/input/web_input_event_traits_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