Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 class FloatPoint; | 43 class FloatPoint; |
| 44 class ScrollableArea; | 44 class ScrollableArea; |
| 45 class Scrollbar; | 45 class Scrollbar; |
| 46 | 46 |
| 47 class PLATFORM_EXPORT ScrollAnimator : public RefCounted<ScrollAnimator> { | 47 class PLATFORM_EXPORT ScrollAnimator : public RefCounted<ScrollAnimator> { |
| 48 public: | 48 public: |
| 49 static PassRefPtr<ScrollAnimator> create(ScrollableArea*); | 49 static PassRefPtr<ScrollAnimator> create(ScrollableArea*); |
| 50 | 50 |
| 51 virtual ~ScrollAnimator(); | 51 virtual ~ScrollAnimator(); |
| 52 | 52 |
| 53 // Computes a scroll destination for the given parameters. Returns false if | 53 // Computes a scroll destination for the given parameters. The returned |
| 54 // already at the destination. Otherwise, starts scrolling towards the | 54 // ScrollResult will have didScroll set to false if already at the |
|
skobes
2015/06/02 19:03:16
ScrollResultOneDimensional
bokan
2015/06/02 21:06:25
Done.
| |
| 55 // destination and returns true. Scrolling may be immediate or animated. | 55 // destination. Otherwise, starts scrolling towards the destination and |
| 56 // The base class implementation always scrolls immediately, never animates. | 56 // didScroll is true. Scrolling may be immediate or animated. The base |
| 57 virtual ScrollResultOneDimensional scroll(ScrollbarOrientation, ScrollGranul arity, float step, float delta); | 57 // class implementation always scrolls immediately, never animates. |
| 58 virtual ScrollResultOneDimensional userScroll(ScrollbarOrientation, ScrollGr anularity, float step, float delta); | |
| 58 | 59 |
| 59 virtual void scrollToOffsetWithoutAnimation(const FloatPoint&); | 60 virtual void scrollToOffsetWithoutAnimation(const FloatPoint&); |
| 60 | 61 |
| 61 ScrollableArea* scrollableArea() const { return m_scrollableArea; } | 62 ScrollableArea* scrollableArea() const { return m_scrollableArea; } |
| 62 | 63 |
| 63 virtual void setIsActive() { } | 64 virtual void setIsActive() { } |
| 64 | 65 |
| 65 virtual ScrollResult handleWheelEvent(const PlatformWheelEvent&); | 66 virtual ScrollResult handleWheelEvent(const PlatformWheelEvent&); |
| 66 | 67 |
| 67 #if OS(MACOSX) | 68 #if OS(MACOSX) |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 108 float m_currentPosX; // We avoid using a FloatPoint in order to reduce | 109 float m_currentPosX; // We avoid using a FloatPoint in order to reduce |
| 109 float m_currentPosY; // subclass code complexity. | 110 float m_currentPosY; // subclass code complexity. |
| 110 | 111 |
| 111 private: | 112 private: |
| 112 float clampScrollPosition(ScrollbarOrientation, float); | 113 float clampScrollPosition(ScrollbarOrientation, float); |
| 113 }; | 114 }; |
| 114 | 115 |
| 115 } // namespace blink | 116 } // namespace blink |
| 116 | 117 |
| 117 #endif // ScrollAnimator_h | 118 #endif // ScrollAnimator_h |
| OLD | NEW |