| 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // Wheel events which do not scroll are used to trigger zooming. |
| 243 if (wheelEvent.modifiers() & PlatformEvent::CtrlKey) | 243 if (wheelEvent.canScroll()) |
| 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 Loading... |
| 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 |
| OLD | NEW |