| 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |