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

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

Issue 212913002: Prevent ctrl+wheel from scrolling in more places (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixes 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
« 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 else if (behaviorString == "smooth") 206 else if (behaviorString == "smooth")
207 behavior = ScrollBehaviorSmooth; 207 behavior = ScrollBehaviorSmooth;
208 else 208 else
209 return false; 209 return false;
210 210
211 return true; 211 return true;
212 } 212 }
213 213
214 bool ScrollableArea::handleWheelEvent(const PlatformWheelEvent& wheelEvent) 214 bool ScrollableArea::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
215 { 215 {
216 // ctrl+wheel events are used to trigger zooming, not scrolling.
217 if (wheelEvent.modifiers() & PlatformEvent::CtrlKey)
218 return false;
219
216 return scrollAnimator()->handleWheelEvent(wheelEvent); 220 return scrollAnimator()->handleWheelEvent(wheelEvent);
217 } 221 }
218 222
219 // NOTE: Only called from Internals for testing. 223 // NOTE: Only called from Internals for testing.
220 void ScrollableArea::setScrollOffsetFromInternals(const IntPoint& offset) 224 void ScrollableArea::setScrollOffsetFromInternals(const IntPoint& offset)
221 { 225 {
222 setScrollOffsetFromAnimation(offset); 226 setScrollOffsetFromAnimation(offset);
223 } 227 }
224 228
225 void ScrollableArea::setScrollOffsetFromAnimation(const IntPoint& offset) 229 void ScrollableArea::setScrollOffsetFromAnimation(const IntPoint& offset)
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 { 430 {
427 return scrollSize(orientation); 431 return scrollSize(orientation);
428 } 432 }
429 433
430 float ScrollableArea::pixelStep(ScrollbarOrientation) const 434 float ScrollableArea::pixelStep(ScrollbarOrientation) const
431 { 435 {
432 return 1; 436 return 1;
433 } 437 }
434 438
435 } // namespace WebCore 439 } // namespace WebCore
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