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

Side by Side Diff: Source/platform/scroll/ScrollableArea.cpp

Issue 768443002: Honor the wheel event canScroll bit instead of trying to infer it from the ctrl modifier (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « Source/core/page/EventHandler.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, Google Inc. All rights reserved.
3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 else if (behaviorString == "smooth") 233 else if (behaviorString == "smooth")
234 behavior = ScrollBehaviorSmooth; 234 behavior = ScrollBehaviorSmooth;
235 else 235 else
236 return false; 236 return false;
237 237
238 return true; 238 return true;
239 } 239 }
240 240
241 bool ScrollableArea::handleWheelEvent(const PlatformWheelEvent& wheelEvent) 241 bool ScrollableArea::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
242 { 242 {
243 // ctrl+wheel events are used to trigger zooming, not scrolling. 243 // Wheel events which do not scroll are used to trigger zooming.
244 if (wheelEvent.modifiers() & PlatformEvent::CtrlKey) 244 if (!wheelEvent.canScroll())
245 return false; 245 return false;
246 246
247 cancelProgrammaticScrollAnimation(); 247 cancelProgrammaticScrollAnimation();
248 return scrollAnimator()->handleWheelEvent(wheelEvent); 248 return scrollAnimator()->handleWheelEvent(wheelEvent);
249 } 249 }
250 250
251 // NOTE: Only called from Internals for testing. 251 // NOTE: Only called from Internals for testing.
252 void ScrollableArea::setScrollOffsetFromInternals(const IntPoint& offset) 252 void ScrollableArea::setScrollOffsetFromInternals(const IntPoint& offset)
253 { 253 {
254 setScrollOffsetFromAnimation(DoublePoint(offset)); 254 setScrollOffsetFromAnimation(DoublePoint(offset));
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 { 511 {
512 return scrollSize(orientation); 512 return scrollSize(orientation);
513 } 513 }
514 514
515 float ScrollableArea::pixelStep(ScrollbarOrientation) const 515 float ScrollableArea::pixelStep(ScrollbarOrientation) const
516 { 516 {
517 return 1; 517 return 1;
518 } 518 }
519 519
520 } // namespace blink 520 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/page/EventHandler.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698