OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |