| 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 27 matching lines...) Expand all Loading... |
| 38 #include "platform/wtf/MathExtras.h" | 38 #include "platform/wtf/MathExtras.h" |
| 39 #include "platform/wtf/Noncopyable.h" | 39 #include "platform/wtf/Noncopyable.h" |
| 40 #include "platform/wtf/Vector.h" | 40 #include "platform/wtf/Vector.h" |
| 41 #include "public/platform/WebLayerScrollClient.h" | 41 #include "public/platform/WebLayerScrollClient.h" |
| 42 | 42 |
| 43 namespace blink { | 43 namespace blink { |
| 44 | 44 |
| 45 class CompositorAnimationHost; | 45 class CompositorAnimationHost; |
| 46 class CompositorAnimationTimeline; | 46 class CompositorAnimationTimeline; |
| 47 class GraphicsLayer; | 47 class GraphicsLayer; |
| 48 class HostWindow; | |
| 49 class LayoutBox; | 48 class LayoutBox; |
| 50 class LayoutObject; | 49 class LayoutObject; |
| 51 class PaintLayer; | 50 class PaintLayer; |
| 51 class PlatformChromeClient; |
| 52 class ProgrammaticScrollAnimator; | 52 class ProgrammaticScrollAnimator; |
| 53 struct ScrollAlignment; | 53 struct ScrollAlignment; |
| 54 class ScrollAnchor; | 54 class ScrollAnchor; |
| 55 class ScrollAnimatorBase; | 55 class ScrollAnimatorBase; |
| 56 class CompositorAnimationTimeline; | 56 class CompositorAnimationTimeline; |
| 57 | 57 |
| 58 enum IncludeScrollbarsInRect { | 58 enum IncludeScrollbarsInRect { |
| 59 kExcludeScrollbars, | 59 kExcludeScrollbars, |
| 60 kIncludeScrollbars, | 60 kIncludeScrollbars, |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 class PLATFORM_EXPORT ScrollableArea : public GarbageCollectedMixin, | 63 class PLATFORM_EXPORT ScrollableArea : public GarbageCollectedMixin, |
| 64 public WebLayerScrollClient { | 64 public WebLayerScrollClient { |
| 65 WTF_MAKE_NONCOPYABLE(ScrollableArea); | 65 WTF_MAKE_NONCOPYABLE(ScrollableArea); |
| 66 | 66 |
| 67 public: | 67 public: |
| 68 static int PixelsPerLineStep(HostWindow*); | 68 static int PixelsPerLineStep(PlatformChromeClient*); |
| 69 static float MinFractionToStepWhenPaging(); | 69 static float MinFractionToStepWhenPaging(); |
| 70 static int MaxOverlapBetweenPages(); | 70 static int MaxOverlapBetweenPages(); |
| 71 | 71 |
| 72 // Convert a non-finite scroll value (Infinity, -Infinity, NaN) to 0 as | 72 // Convert a non-finite scroll value (Infinity, -Infinity, NaN) to 0 as |
| 73 // per http://dev.w3.org/csswg/cssom-view/#normalize-non_finite-values. | 73 // per http://dev.w3.org/csswg/cssom-view/#normalize-non_finite-values. |
| 74 static float NormalizeNonFiniteScroll(float value) { | 74 static float NormalizeNonFiniteScroll(float value) { |
| 75 return std::isfinite(value) ? value : 0.0; | 75 return std::isfinite(value) ? value : 0.0; |
| 76 } | 76 } |
| 77 | 77 |
| 78 // The window that hosts the ScrollableArea. The ScrollableArea will | 78 virtual PlatformChromeClient* GetChromeClient() const { return 0; } |
| 79 // communicate scrolls and repaints to the host window in the window's | |
| 80 // coordinate space. | |
| 81 virtual HostWindow* GetHostWindow() const { return 0; } | |
| 82 | 79 |
| 83 virtual ScrollResult UserScroll(ScrollGranularity, const ScrollOffset&); | 80 virtual ScrollResult UserScroll(ScrollGranularity, const ScrollOffset&); |
| 84 | 81 |
| 85 virtual void SetScrollOffset(const ScrollOffset&, | 82 virtual void SetScrollOffset(const ScrollOffset&, |
| 86 ScrollType, | 83 ScrollType, |
| 87 ScrollBehavior = kScrollBehaviorInstant); | 84 ScrollBehavior = kScrollBehaviorInstant); |
| 88 virtual void ScrollBy(const ScrollOffset&, | 85 virtual void ScrollBy(const ScrollOffset&, |
| 89 ScrollType, | 86 ScrollType, |
| 90 ScrollBehavior = kScrollBehaviorInstant); | 87 ScrollBehavior = kScrollBehaviorInstant); |
| 91 void SetScrollOffsetSingleAxis(ScrollbarOrientation, | 88 void SetScrollOffsetSingleAxis(ScrollbarOrientation, |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 // vertical-lr / ltr NO NO | 456 // vertical-lr / ltr NO NO |
| 460 // vertical-lr / rtl NO YES | 457 // vertical-lr / rtl NO YES |
| 461 // vertical-rl / ltr YES NO | 458 // vertical-rl / ltr YES NO |
| 462 // vertical-rl / rtl YES YES | 459 // vertical-rl / rtl YES YES |
| 463 IntPoint scroll_origin_; | 460 IntPoint scroll_origin_; |
| 464 }; | 461 }; |
| 465 | 462 |
| 466 } // namespace blink | 463 } // namespace blink |
| 467 | 464 |
| 468 #endif // ScrollableArea_h | 465 #endif // ScrollableArea_h |
| OLD | NEW |