| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 return m_animators ? m_animators->programmaticScrollAnimator.get() : 0; | 122 return m_animators ? m_animators->programmaticScrollAnimator.get() : 0; |
| 123 } | 123 } |
| 124 | 124 |
| 125 const IntPoint& scrollOrigin() const { return m_scrollOrigin; } | 125 const IntPoint& scrollOrigin() const { return m_scrollOrigin; } |
| 126 bool scrollOriginChanged() const { return m_scrollOriginChanged; } | 126 bool scrollOriginChanged() const { return m_scrollOriginChanged; } |
| 127 | 127 |
| 128 // FIXME(bokan): Meaningless name, rename to isActiveFocus | 128 // FIXME(bokan): Meaningless name, rename to isActiveFocus |
| 129 virtual bool isActive() const = 0; | 129 virtual bool isActive() const = 0; |
| 130 virtual int scrollSize(ScrollbarOrientation) const = 0; | 130 virtual int scrollSize(ScrollbarOrientation) const = 0; |
| 131 virtual void invalidateScrollbar(Scrollbar*, const IntRect&); | 131 virtual void invalidateScrollbar(Scrollbar*, const IntRect&); |
| 132 virtual bool isScrollCornerVisible() const = 0; | |
| 133 virtual IntRect scrollCornerRect() const = 0; | |
| 134 virtual void invalidateScrollCorner(const IntRect&); | |
| 135 | 132 |
| 136 // Convert points and rects between the scrollbar and its containing view. | 133 // Convert points and rects between the scrollbar and its containing view. |
| 137 // The client needs to implement these in order to be aware of layout effect
s | 134 // The client needs to implement these in order to be aware of layout effect
s |
| 138 // like CSS transforms. | 135 // like CSS transforms. |
| 139 virtual IntRect convertFromScrollbarToContainingView(const Scrollbar* scroll
bar, const IntRect& scrollbarRect) const = 0; | 136 virtual IntRect convertFromScrollbarToContainingView(const Scrollbar* scroll
bar, const IntRect& scrollbarRect) const = 0; |
| 140 virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar* scroll
bar, const IntRect& parentRect) const = 0; | 137 virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar* scroll
bar, const IntRect& parentRect) const = 0; |
| 141 virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar* scrol
lbar, const IntPoint& scrollbarPoint) const = 0; | 138 virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar* scrol
lbar, const IntPoint& scrollbarPoint) const = 0; |
| 142 virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar* scrol
lbar, const IntPoint& parentPoint) const = 0; | 139 virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar* scrol
lbar, const IntPoint& parentPoint) const = 0; |
| 143 | 140 |
| 144 virtual Scrollbar* horizontalScrollbar() const = 0; | 141 virtual Scrollbar* horizontalScrollbar() const = 0; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 void resetScrollbarDamage() | 199 void resetScrollbarDamage() |
| 203 { | 200 { |
| 204 m_verticalBarDamage = IntRect(); | 201 m_verticalBarDamage = IntRect(); |
| 205 m_horizontalBarDamage = IntRect(); | 202 m_horizontalBarDamage = IntRect(); |
| 206 } | 203 } |
| 207 | 204 |
| 208 virtual GraphicsLayer* layerForContainer() const; | 205 virtual GraphicsLayer* layerForContainer() const; |
| 209 virtual GraphicsLayer* layerForScrolling() const { return 0; } | 206 virtual GraphicsLayer* layerForScrolling() const { return 0; } |
| 210 virtual GraphicsLayer* layerForHorizontalScrollbar() const { return 0; } | 207 virtual GraphicsLayer* layerForHorizontalScrollbar() const { return 0; } |
| 211 virtual GraphicsLayer* layerForVerticalScrollbar() const { return 0; } | 208 virtual GraphicsLayer* layerForVerticalScrollbar() const { return 0; } |
| 212 virtual GraphicsLayer* layerForScrollCorner() const { return 0; } | |
| 213 bool hasLayerForHorizontalScrollbar() const; | 209 bool hasLayerForHorizontalScrollbar() const; |
| 214 bool hasLayerForVerticalScrollbar() const; | 210 bool hasLayerForVerticalScrollbar() const; |
| 215 bool hasLayerForScrollCorner() const; | |
| 216 | 211 |
| 217 void cancelProgrammaticScrollAnimation(); | 212 void cancelProgrammaticScrollAnimation(); |
| 218 | 213 |
| 219 protected: | 214 protected: |
| 220 ScrollableArea(); | 215 ScrollableArea(); |
| 221 virtual ~ScrollableArea(); | 216 virtual ~ScrollableArea(); |
| 222 | 217 |
| 223 void setScrollOrigin(const IntPoint&); | 218 void setScrollOrigin(const IntPoint&); |
| 224 void resetScrollOriginChanged() { m_scrollOriginChanged = false; } | 219 void resetScrollOriginChanged() { m_scrollOriginChanged = false; } |
| 225 | 220 |
| 226 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) = 0; | 221 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) = 0; |
| 227 virtual void invalidateScrollCornerRect(const IntRect&) = 0; | |
| 228 | 222 |
| 229 private: | 223 private: |
| 230 void scrollPositionChanged(const IntPoint&); | 224 void scrollPositionChanged(const IntPoint&); |
| 231 | 225 |
| 232 // NOTE: Only called from the ScrollAnimator. | 226 // NOTE: Only called from the ScrollAnimator. |
| 233 friend class ScrollAnimator; | 227 friend class ScrollAnimator; |
| 234 void setScrollOffsetFromAnimation(const IntPoint&); | 228 void setScrollOffsetFromAnimation(const IntPoint&); |
| 235 | 229 |
| 236 // This function should be overriden by subclasses to perform the actual | 230 // This function should be overriden by subclasses to perform the actual |
| 237 // scroll of the content. | 231 // scroll of the content. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 // vertical-lr / ltr NO NO | 267 // vertical-lr / ltr NO NO |
| 274 // vertical-lr / rtl NO YES | 268 // vertical-lr / rtl NO YES |
| 275 // vertical-rl / ltr YES NO | 269 // vertical-rl / ltr YES NO |
| 276 // vertical-rl / rtl YES YES | 270 // vertical-rl / rtl YES YES |
| 277 IntPoint m_scrollOrigin; | 271 IntPoint m_scrollOrigin; |
| 278 }; | 272 }; |
| 279 | 273 |
| 280 } // namespace blink | 274 } // namespace blink |
| 281 | 275 |
| 282 #endif // ScrollableArea_h | 276 #endif // ScrollableArea_h |
| OLD | NEW |