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

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

Issue 739013008: 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 286
287 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleMouseWheel( 287 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleMouseWheel(
288 const WebMouseWheelEvent& wheel_event) { 288 const WebMouseWheelEvent& wheel_event) {
289 InputHandlerProxy::EventDisposition result = DID_NOT_HANDLE; 289 InputHandlerProxy::EventDisposition result = DID_NOT_HANDLE;
290 cc::InputHandlerScrollResult scroll_result; 290 cc::InputHandlerScrollResult scroll_result;
291 291
292 if (wheel_event.scrollByPage) { 292 if (wheel_event.scrollByPage) {
293 // TODO(jamesr): We don't properly handle scroll by page in the compositor 293 // TODO(jamesr): We don't properly handle scroll by page in the compositor
294 // thread, so punt it to the main thread. http://crbug.com/236639 294 // thread, so punt it to the main thread. http://crbug.com/236639
295 result = DID_NOT_HANDLE; 295 result = DID_NOT_HANDLE;
296 } else if (wheel_event.modifiers & WebInputEvent::ControlKey) { 296 } else if (wheel_event.suppressScroll) {
297 // Wheel events involving the control key never trigger scrolling, only 297 // Wheel events involving the control key never trigger scrolling, only
Rick Byers 2014/11/27 17:31:32 Update this comment since it's no longer true - co
lanwei 2014/12/02 06:28:54 Done.
298 // event handlers. Forward to the main thread. 298 // event handlers. Forward to the main thread.
299 result = DID_NOT_HANDLE; 299 result = DID_NOT_HANDLE;
300 } else if (smooth_scroll_enabled_) { 300 } else if (smooth_scroll_enabled_) {
301 cc::InputHandler::ScrollStatus scroll_status = 301 cc::InputHandler::ScrollStatus scroll_status =
302 input_handler_->ScrollAnimated( 302 input_handler_->ScrollAnimated(
303 gfx::Point(wheel_event.x, wheel_event.y), 303 gfx::Point(wheel_event.x, wheel_event.y),
304 gfx::Vector2dF(-wheel_event.deltaX, -wheel_event.deltaY)); 304 gfx::Vector2dF(-wheel_event.deltaX, -wheel_event.deltaY));
305 switch (scroll_status) { 305 switch (scroll_status) {
306 case cc::InputHandler::ScrollStarted: 306 case cc::InputHandler::ScrollStarted:
307 result = DID_HANDLE; 307 result = DID_HANDLE;
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 // trigger a scroll, e.g., with a trivial time delta between fling updates. 887 // trigger a scroll, e.g., with a trivial time delta between fling updates.
888 // Return true in this case to prevent early fling termination. 888 // Return true in this case to prevent early fling termination.
889 if (std::abs(clipped_increment.width) < kScrollEpsilon && 889 if (std::abs(clipped_increment.width) < kScrollEpsilon &&
890 std::abs(clipped_increment.height) < kScrollEpsilon) 890 std::abs(clipped_increment.height) < kScrollEpsilon)
891 return true; 891 return true;
892 892
893 return did_scroll; 893 return did_scroll;
894 } 894 }
895 895
896 } // namespace content 896 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698