| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 virtual ~ScrollAnimator(); | 51 virtual ~ScrollAnimator(); |
| 52 | 52 |
| 53 // Computes a scroll destination for the given parameters. The returned | 53 // Computes a scroll destination for the given parameters. The returned |
| 54 // ScrollResultOneDimensional will have didScroll set to false if already at | 54 // ScrollResultOneDimensional will have didScroll set to false if already at |
| 55 // the destination. Otherwise, starts scrolling towards the destination and | 55 // the destination. Otherwise, starts scrolling towards the destination and |
| 56 // didScroll is true. Scrolling may be immediate or animated. The base | 56 // didScroll is true. Scrolling may be immediate or animated. The base |
| 57 // class implementation always scrolls immediately, never animates. | 57 // class implementation always scrolls immediately, never animates. |
| 58 virtual ScrollResultOneDimensional userScroll(ScrollbarOrientation, ScrollGr
anularity, float step, float delta); | 58 virtual ScrollResultOneDimensional userScroll(ScrollbarOrientation, ScrollGr
anularity, float step, float delta); |
| 59 | 59 |
| 60 virtual void scrollToOffsetWithoutAnimation(const FloatPoint&, ScrollType); | 60 virtual void scrollToOffsetWithoutAnimation(const FloatPoint&); |
| 61 | 61 |
| 62 ScrollableArea* scrollableArea() const { return m_scrollableArea; } | 62 ScrollableArea* scrollableArea() const { return m_scrollableArea; } |
| 63 | 63 |
| 64 virtual void setIsActive() { } | 64 virtual void setIsActive() { } |
| 65 | 65 |
| 66 virtual ScrollResult handleWheelEvent(const PlatformWheelEvent&); | 66 virtual ScrollResult handleWheelEvent(const PlatformWheelEvent&); |
| 67 | 67 |
| 68 #if OS(MACOSX) | 68 #if OS(MACOSX) |
| 69 virtual void handleWheelEventPhase(PlatformWheelEventPhase) { } | 69 virtual void handleWheelEventPhase(PlatformWheelEventPhase) { } |
| 70 #endif | 70 #endif |
| (...skipping 25 matching lines...) Expand all Loading... |
| 96 virtual void didAddHorizontalScrollbar(Scrollbar*) { } | 96 virtual void didAddHorizontalScrollbar(Scrollbar*) { } |
| 97 virtual void willRemoveHorizontalScrollbar(Scrollbar*) { } | 97 virtual void willRemoveHorizontalScrollbar(Scrollbar*) { } |
| 98 | 98 |
| 99 virtual bool shouldScrollbarParticipateInHitTesting(Scrollbar*) { return tru
e; } | 99 virtual bool shouldScrollbarParticipateInHitTesting(Scrollbar*) { return tru
e; } |
| 100 | 100 |
| 101 virtual void notifyContentAreaScrolled(const FloatSize&) { } | 101 virtual void notifyContentAreaScrolled(const FloatSize&) { } |
| 102 | 102 |
| 103 protected: | 103 protected: |
| 104 explicit ScrollAnimator(ScrollableArea*); | 104 explicit ScrollAnimator(ScrollableArea*); |
| 105 | 105 |
| 106 virtual void notifyPositionChanged(ScrollType); | 106 virtual void notifyPositionChanged(); |
| 107 | 107 |
| 108 ScrollableArea* m_scrollableArea; | 108 ScrollableArea* m_scrollableArea; |
| 109 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 |
| 110 float m_currentPosY; // subclass code complexity. | 110 float m_currentPosY; // subclass code complexity. |
| 111 | 111 |
| 112 private: | 112 private: |
| 113 float clampScrollPosition(ScrollbarOrientation, float); | 113 float clampScrollPosition(ScrollbarOrientation, float); |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 } // namespace blink | 116 } // namespace blink |
| 117 | 117 |
| 118 #endif // ScrollAnimator_h | 118 #endif // ScrollAnimator_h |
| OLD | NEW |