| 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 26 matching lines...) Expand all Loading... |
| 37 #include "platform/heap/Handle.h" | 37 #include "platform/heap/Handle.h" |
| 38 #include "platform/scroll/ScrollTypes.h" | 38 #include "platform/scroll/ScrollTypes.h" |
| 39 #include "wtf/Forward.h" | 39 #include "wtf/Forward.h" |
| 40 | 40 |
| 41 namespace blink { | 41 namespace blink { |
| 42 | 42 |
| 43 class FloatPoint; | 43 class FloatPoint; |
| 44 class ScrollableArea; | 44 class ScrollableArea; |
| 45 class Scrollbar; | 45 class Scrollbar; |
| 46 | 46 |
| 47 class PLATFORM_EXPORT ScrollAnimatorBase { | 47 class PLATFORM_EXPORT ScrollAnimatorBase : public GarbageCollectedFinalized<Scro
llAnimatorBase> { |
| 48 public: | 48 public: |
| 49 static PassOwnPtr<ScrollAnimatorBase> create(ScrollableArea*); | 49 static ScrollAnimatorBase* create(ScrollableArea*); |
| 50 | 50 |
| 51 virtual ~ScrollAnimatorBase(); | 51 virtual ~ScrollAnimatorBase(); |
| 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 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 virtual void didAddVerticalScrollbar(Scrollbar*) { } | 92 virtual void didAddVerticalScrollbar(Scrollbar*) { } |
| 93 virtual void willRemoveVerticalScrollbar(Scrollbar*) { } | 93 virtual void willRemoveVerticalScrollbar(Scrollbar*) { } |
| 94 virtual void didAddHorizontalScrollbar(Scrollbar*) { } | 94 virtual void didAddHorizontalScrollbar(Scrollbar*) { } |
| 95 virtual void willRemoveHorizontalScrollbar(Scrollbar*) { } | 95 virtual void willRemoveHorizontalScrollbar(Scrollbar*) { } |
| 96 | 96 |
| 97 virtual bool shouldScrollbarParticipateInHitTesting(Scrollbar*) { return tru
e; } | 97 virtual bool shouldScrollbarParticipateInHitTesting(Scrollbar*) { return tru
e; } |
| 98 | 98 |
| 99 virtual void notifyContentAreaScrolled(const FloatSize&) { } | 99 virtual void notifyContentAreaScrolled(const FloatSize&) { } |
| 100 | 100 |
| 101 virtual bool setScrollbarsVisibleForTesting(bool) { return false; } | 101 virtual bool setScrollbarsVisibleForTesting(bool) { return false; } |
| 102 |
| 103 DECLARE_VIRTUAL_TRACE(); |
| 104 |
| 102 protected: | 105 protected: |
| 103 explicit ScrollAnimatorBase(ScrollableArea*); | 106 explicit ScrollAnimatorBase(ScrollableArea*); |
| 104 | 107 |
| 105 virtual void notifyPositionChanged(); | 108 virtual void notifyPositionChanged(); |
| 106 | 109 |
| 107 GC_PLUGIN_IGNORE("509911") | 110 RawPtrWillBeMember<ScrollableArea> m_scrollableArea; |
| 108 ScrollableArea* m_scrollableArea; | |
| 109 float m_currentPosX; // We avoid using a FloatPoint in order to reduce | 111 float m_currentPosX; // We avoid using a FloatPoint in order to reduce |
| 110 float m_currentPosY; // subclass code complexity. | 112 float m_currentPosY; // subclass code complexity. |
| 111 | 113 |
| 112 private: | 114 private: |
| 113 float clampScrollPosition(ScrollbarOrientation, float); | 115 float clampScrollPosition(ScrollbarOrientation, float); |
| 114 }; | 116 }; |
| 115 | 117 |
| 116 } // namespace blink | 118 } // namespace blink |
| 117 | 119 |
| 118 #endif // ScrollAnimatorBase_h | 120 #endif // ScrollAnimatorBase_h |
| OLD | NEW |