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

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 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 /* 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 else if (behaviorString == "smooth") 232 else if (behaviorString == "smooth")
233 behavior = ScrollBehaviorSmooth; 233 behavior = ScrollBehaviorSmooth;
234 else 234 else
235 return false; 235 return false;
236 236
237 return true; 237 return true;
238 } 238 }
239 239
240 bool ScrollableArea::handleWheelEvent(const PlatformWheelEvent& wheelEvent) 240 bool ScrollableArea::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
241 { 241 {
242 // ctrl+wheel events are used to trigger zooming, not scrolling. 242 // Method suppressScroll() are used to trigger zooming, not scrolling.
tdresser 2014/11/27 15:06:09 Reword to: Wheel events whose scrolling has been
lanwei 2014/12/02 15:48:10 Done.
243 if (wheelEvent.modifiers() & PlatformEvent::CtrlKey) 243 if (wheelEvent.suppressScroll())
244 return false; 244 return false;
245 245
246 cancelProgrammaticScrollAnimation(); 246 cancelProgrammaticScrollAnimation();
247 return scrollAnimator()->handleWheelEvent(wheelEvent); 247 return scrollAnimator()->handleWheelEvent(wheelEvent);
248 } 248 }
249 249
250 // NOTE: Only called from Internals for testing. 250 // NOTE: Only called from Internals for testing.
251 void ScrollableArea::setScrollOffsetFromInternals(const IntPoint& offset) 251 void ScrollableArea::setScrollOffsetFromInternals(const IntPoint& offset)
252 { 252 {
253 setScrollOffsetFromAnimation(DoublePoint(offset)); 253 setScrollOffsetFromAnimation(DoublePoint(offset));
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 { 483 {
484 return scrollSize(orientation); 484 return scrollSize(orientation);
485 } 485 }
486 486
487 float ScrollableArea::pixelStep(ScrollbarOrientation) const 487 float ScrollableArea::pixelStep(ScrollbarOrientation) const
488 { 488 {
489 return 1; 489 return 1;
490 } 490 }
491 491
492 } // namespace blink 492 } // namespace blink
OLDNEW
« Source/core/page/EventHandler.cpp ('K') | « Source/core/page/EventHandler.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698