OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008, 2011 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 public: | 58 public: |
59 static int pixelsPerLineStep(); | 59 static int pixelsPerLineStep(); |
60 static float minFractionToStepWhenPaging(); | 60 static float minFractionToStepWhenPaging(); |
61 static int maxOverlapBetweenPages(); | 61 static int maxOverlapBetweenPages(); |
62 | 62 |
63 // The window that hosts the ScrollableArea. The ScrollableArea will communi
cate scrolls and repaints to the | 63 // The window that hosts the ScrollableArea. The ScrollableArea will communi
cate scrolls and repaints to the |
64 // host window in the window's coordinate space. | 64 // host window in the window's coordinate space. |
65 virtual HostWindow* hostWindow() const { return 0; }; | 65 virtual HostWindow* hostWindow() const { return 0; }; |
66 | 66 |
67 bool scroll(ScrollDirection, ScrollGranularity, float delta = 1); | 67 bool scroll(ScrollDirection, ScrollGranularity, float delta = 1); |
68 void scrollToOffsetWithoutAnimation(const FloatPoint&); | 68 void scrollToOffsetWithoutAnimation(const FloatPoint&, bool cancelProgrammat
icAnimations = true); |
69 void scrollToOffsetWithoutAnimation(ScrollbarOrientation, float offset); | 69 void scrollToOffsetWithoutAnimation(ScrollbarOrientation, float offset); |
70 | 70 |
71 void programmaticallyScrollSmoothlyToOffset(const FloatPoint&); | 71 void programmaticallyScrollSmoothlyToOffset(const FloatPoint&); |
72 | 72 |
73 // Should be called when the scroll position changes externally, for example
if the scroll layer position | 73 // Should be called when the scroll position changes externally, for example
if the scroll layer position |
74 // is updated on the scrolling thread and we need to notify the main thread. | 74 // is updated on the scrolling thread and we need to notify the main thread. |
75 void notifyScrollPositionChanged(const IntPoint&); | 75 void notifyScrollPositionChanged(const IntPoint&); |
76 | 76 |
77 static bool scrollBehaviorFromString(const String&, ScrollBehavior&); | 77 static bool scrollBehaviorFromString(const String&, ScrollBehavior&); |
78 | 78 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 | 199 |
200 // NOTE: Only called from Internals for testing. | 200 // NOTE: Only called from Internals for testing. |
201 void setScrollOffsetFromInternals(const IntPoint&); | 201 void setScrollOffsetFromInternals(const IntPoint&); |
202 | 202 |
203 IntPoint clampScrollPosition(const IntPoint&) const; | 203 IntPoint clampScrollPosition(const IntPoint&) const; |
204 | 204 |
205 // Let subclasses provide a way of asking for and servicing scroll | 205 // Let subclasses provide a way of asking for and servicing scroll |
206 // animations. | 206 // animations. |
207 bool scheduleAnimation(); | 207 bool scheduleAnimation(); |
208 void serviceScrollAnimations(double monotonicTime); | 208 void serviceScrollAnimations(double monotonicTime); |
| 209 void updateCompositorScrollAnimations(); |
209 virtual void registerForAnimation() { } | 210 virtual void registerForAnimation() { } |
210 virtual void deregisterForAnimation() { } | 211 virtual void deregisterForAnimation() { } |
211 | 212 |
| 213 void notifyCompositorAnimationFinished(int groupId); |
| 214 |
212 virtual bool usesCompositedScrolling() const { return false; } | 215 virtual bool usesCompositedScrolling() const { return false; } |
213 | 216 |
214 // Returns true if the GraphicsLayer tree needs to be rebuilt. | 217 // Returns true if the GraphicsLayer tree needs to be rebuilt. |
215 virtual bool updateAfterCompositingChange() { return false; } | 218 virtual bool updateAfterCompositingChange() { return false; } |
216 | 219 |
217 virtual bool userInputScrollable(ScrollbarOrientation) const = 0; | 220 virtual bool userInputScrollable(ScrollbarOrientation) const = 0; |
218 virtual bool shouldPlaceVerticalScrollbarOnLeft() const = 0; | 221 virtual bool shouldPlaceVerticalScrollbarOnLeft() const = 0; |
219 | 222 |
220 // Convenience functions | 223 // Convenience functions |
221 int scrollPosition(ScrollbarOrientation orientation) { return orientation ==
HorizontalScrollbar ? scrollPosition().x() : scrollPosition().y(); } | 224 int scrollPosition(ScrollbarOrientation orientation) { return orientation ==
HorizontalScrollbar ? scrollPosition().x() : scrollPosition().y(); } |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 // vertical-lr / ltr NO NO | 322 // vertical-lr / ltr NO NO |
320 // vertical-lr / rtl NO YES | 323 // vertical-lr / rtl NO YES |
321 // vertical-rl / ltr YES NO | 324 // vertical-rl / ltr YES NO |
322 // vertical-rl / rtl YES YES | 325 // vertical-rl / rtl YES YES |
323 IntPoint m_scrollOrigin; | 326 IntPoint m_scrollOrigin; |
324 }; | 327 }; |
325 | 328 |
326 } // namespace blink | 329 } // namespace blink |
327 | 330 |
328 #endif // ScrollableArea_h | 331 #endif // ScrollableArea_h |
OLD | NEW |