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 18 matching lines...) Expand all Loading... |
29 */ | 29 */ |
30 | 30 |
31 #ifndef ScrollAnimator_h | 31 #ifndef ScrollAnimator_h |
32 #define ScrollAnimator_h | 32 #define ScrollAnimator_h |
33 | 33 |
34 #include "platform/PlatformExport.h" | 34 #include "platform/PlatformExport.h" |
35 #include "platform/PlatformWheelEvent.h" | 35 #include "platform/PlatformWheelEvent.h" |
36 #include "platform/geometry/FloatSize.h" | 36 #include "platform/geometry/FloatSize.h" |
37 #include "platform/scroll/ScrollTypes.h" | 37 #include "platform/scroll/ScrollTypes.h" |
38 #include "wtf/Forward.h" | 38 #include "wtf/Forward.h" |
39 #include "wtf/RefCounted.h" | |
40 | 39 |
41 namespace blink { | 40 namespace blink { |
42 | 41 |
43 class FloatPoint; | 42 class FloatPoint; |
44 class ScrollableArea; | 43 class ScrollableArea; |
45 class Scrollbar; | 44 class Scrollbar; |
46 | 45 |
47 class PLATFORM_EXPORT ScrollAnimator : public RefCounted<ScrollAnimator> { | 46 class PLATFORM_EXPORT ScrollAnimator { |
48 public: | 47 public: |
49 static PassRefPtr<ScrollAnimator> create(ScrollableArea*); | 48 static PassOwnPtr<ScrollAnimator> create(ScrollableArea*); |
50 | 49 |
51 virtual ~ScrollAnimator(); | 50 virtual ~ScrollAnimator(); |
52 | 51 |
53 // Computes a scroll destination for the given parameters. The returned | 52 // Computes a scroll destination for the given parameters. The returned |
54 // ScrollResultOneDimensional will have didScroll set to false if already at | 53 // ScrollResultOneDimensional will have didScroll set to false if already at |
55 // the destination. Otherwise, starts scrolling towards the destination and | 54 // the destination. Otherwise, starts scrolling towards the destination and |
56 // didScroll is true. Scrolling may be immediate or animated. The base | 55 // didScroll is true. Scrolling may be immediate or animated. The base |
57 // class implementation always scrolls immediately, never animates. | 56 // class implementation always scrolls immediately, never animates. |
58 virtual ScrollResultOneDimensional userScroll(ScrollbarOrientation, ScrollGr
anularity, float step, float delta); | 57 virtual ScrollResultOneDimensional userScroll(ScrollbarOrientation, ScrollGr
anularity, float step, float delta); |
59 | 58 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 float m_currentPosX; // We avoid using a FloatPoint in order to reduce | 108 float m_currentPosX; // We avoid using a FloatPoint in order to reduce |
110 float m_currentPosY; // subclass code complexity. | 109 float m_currentPosY; // subclass code complexity. |
111 | 110 |
112 private: | 111 private: |
113 float clampScrollPosition(ScrollbarOrientation, float); | 112 float clampScrollPosition(ScrollbarOrientation, float); |
114 }; | 113 }; |
115 | 114 |
116 } // namespace blink | 115 } // namespace blink |
117 | 116 |
118 #endif // ScrollAnimator_h | 117 #endif // ScrollAnimator_h |
OLD | NEW |