| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 if (verticalScrollbar) { | 181 if (verticalScrollbar) { |
| 182 verticalScrollbar->offsetDidChange(); | 182 verticalScrollbar->offsetDidChange(); |
| 183 if (verticalScrollbar->isOverlayScrollbar() && !hasLayerForVerticalScrol
lbar()) | 183 if (verticalScrollbar->isOverlayScrollbar() && !hasLayerForVerticalScrol
lbar()) |
| 184 verticalScrollbar->invalidate(); | 184 verticalScrollbar->invalidate(); |
| 185 } | 185 } |
| 186 | 186 |
| 187 if (scrollPosition() != oldPosition) | 187 if (scrollPosition() != oldPosition) |
| 188 scrollAnimator()->notifyContentAreaScrolled(scrollPosition() - oldPositi
on); | 188 scrollAnimator()->notifyContentAreaScrolled(scrollPosition() - oldPositi
on); |
| 189 } | 189 } |
| 190 | 190 |
| 191 bool ScrollableArea::scrollBehaviorFromString(const String& behaviorString, Scro
llBehavior& behavior) |
| 192 { |
| 193 if (behaviorString == "auto") |
| 194 behavior = ScrollBehaviorAuto; |
| 195 else if (behaviorString == "instant") |
| 196 behavior = ScrollBehaviorInstant; |
| 197 else if (behaviorString == "smooth") |
| 198 behavior = ScrollBehaviorSmooth; |
| 199 else |
| 200 return false; |
| 201 |
| 202 return true; |
| 203 } |
| 204 |
| 191 bool ScrollableArea::handleWheelEvent(const PlatformWheelEvent& wheelEvent) | 205 bool ScrollableArea::handleWheelEvent(const PlatformWheelEvent& wheelEvent) |
| 192 { | 206 { |
| 193 return scrollAnimator()->handleWheelEvent(wheelEvent); | 207 return scrollAnimator()->handleWheelEvent(wheelEvent); |
| 194 } | 208 } |
| 195 | 209 |
| 196 // NOTE: Only called from Internals for testing. | 210 // NOTE: Only called from Internals for testing. |
| 197 void ScrollableArea::setScrollOffsetFromInternals(const IntPoint& offset) | 211 void ScrollableArea::setScrollOffsetFromInternals(const IntPoint& offset) |
| 198 { | 212 { |
| 199 setScrollOffsetFromAnimation(offset); | 213 setScrollOffsetFromAnimation(offset); |
| 200 } | 214 } |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 { | 414 { |
| 401 return scrollSize(orientation); | 415 return scrollSize(orientation); |
| 402 } | 416 } |
| 403 | 417 |
| 404 float ScrollableArea::pixelStep(ScrollbarOrientation) const | 418 float ScrollableArea::pixelStep(ScrollbarOrientation) const |
| 405 { | 419 { |
| 406 return 1; | 420 return 1; |
| 407 } | 421 } |
| 408 | 422 |
| 409 } // namespace WebCore | 423 } // namespace WebCore |
| OLD | NEW |