Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Side by Side Diff: Source/core/paint/DeprecatedPaintLayerScrollableArea.h

Issue 1215973002: Oilpan: improve ScrollableArea handling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: clear out animators on DeprecatedPaintLayerScrollableArea dispose Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 29 matching lines...) Expand all
40 * If you do not delete the provisions above, a recipient may use your 40 * If you do not delete the provisions above, a recipient may use your
41 * version of this file under any of the LGPL, the MPL or the GPL. 41 * version of this file under any of the LGPL, the MPL or the GPL.
42 */ 42 */
43 43
44 #ifndef DeprecatedPaintLayerScrollableArea_h 44 #ifndef DeprecatedPaintLayerScrollableArea_h
45 #define DeprecatedPaintLayerScrollableArea_h 45 #define DeprecatedPaintLayerScrollableArea_h
46 46
47 #include "core/CoreExport.h" 47 #include "core/CoreExport.h"
48 #include "core/layout/LayoutBox.h" 48 #include "core/layout/LayoutBox.h"
49 #include "core/paint/DeprecatedPaintLayerFragment.h" 49 #include "core/paint/DeprecatedPaintLayerFragment.h"
50 #include "platform/heap/Handle.h"
50 #include "platform/scroll/ScrollableArea.h" 51 #include "platform/scroll/ScrollableArea.h"
51 52
52 namespace blink { 53 namespace blink {
53 54
54 enum ResizerHitTestType { 55 enum ResizerHitTestType {
55 ResizerForPointer, 56 ResizerForPointer,
56 ResizerForTouch 57 ResizerForTouch
57 }; 58 };
58 59
59 class PlatformEvent; 60 class PlatformEvent;
60 class LayoutBox; 61 class LayoutBox;
61 class DeprecatedPaintLayer; 62 class DeprecatedPaintLayer;
62 class LayoutScrollbarPart; 63 class LayoutScrollbarPart;
63 64
64 class CORE_EXPORT DeprecatedPaintLayerScrollableArea final : public ScrollableAr ea { 65 class CORE_EXPORT DeprecatedPaintLayerScrollableArea final : public NoBaseWillBe GarbageCollectedFinalized<DeprecatedPaintLayerScrollableArea>, public Scrollable Area {
66 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DeprecatedPaintLayerScrollableArea);
65 friend class Internals; 67 friend class Internals;
66 68
67 public: 69 public:
68 // FIXME: We should pass in the LayoutBox but this opens a window 70 // FIXME: We should pass in the LayoutBox but this opens a window
69 // for crashers during DeprecatedPaintLayer setup (see crbug.com/368062). 71 // for crashers during DeprecatedPaintLayer setup (see crbug.com/368062).
70 DeprecatedPaintLayerScrollableArea(DeprecatedPaintLayer&); 72 static PassOwnPtrWillBeRawPtr<DeprecatedPaintLayerScrollableArea> create(Dep recatedPaintLayer& layer)
73 {
74 return adoptPtrWillBeNoop(new DeprecatedPaintLayerScrollableArea(layer)) ;
75 }
76
71 virtual ~DeprecatedPaintLayerScrollableArea(); 77 virtual ~DeprecatedPaintLayerScrollableArea();
78 void dispose();
72 79
73 bool hasHorizontalScrollbar() const { return horizontalScrollbar(); } 80 bool hasHorizontalScrollbar() const { return horizontalScrollbar(); }
74 bool hasVerticalScrollbar() const { return verticalScrollbar(); } 81 bool hasVerticalScrollbar() const { return verticalScrollbar(); }
75 82
76 virtual Scrollbar* horizontalScrollbar() const override { return m_hBar.get( ); } 83 virtual Scrollbar* horizontalScrollbar() const override { return m_hBar.get( ); }
77 virtual Scrollbar* verticalScrollbar() const override { return m_vBar.get(); } 84 virtual Scrollbar* verticalScrollbar() const override { return m_vBar.get(); }
78 85
79 virtual HostWindow* hostWindow() const override; 86 virtual HostWindow* hostWindow() const override;
80 87
81 virtual GraphicsLayer* layerForScrolling() const override; 88 virtual GraphicsLayer* layerForScrolling() const override;
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 DeprecatedPaintLayer* layer() const; 215 DeprecatedPaintLayer* layer() const;
209 216
210 LayoutScrollbarPart* resizer() { return m_resizer; } 217 LayoutScrollbarPart* resizer() { return m_resizer; }
211 218
212 const IntPoint& cachedOverlayScrollbarOffset() { return m_cachedOverlayScrol lbarOffset; } 219 const IntPoint& cachedOverlayScrollbarOffset() { return m_cachedOverlayScrol lbarOffset; }
213 void setCachedOverlayScrollbarOffset(const IntPoint& offset) { m_cachedOverl ayScrollbarOffset = offset; } 220 void setCachedOverlayScrollbarOffset(const IntPoint& offset) { m_cachedOverl ayScrollbarOffset = offset; }
214 221
215 IntRect rectForHorizontalScrollbar(const IntRect& borderBoxRect) const; 222 IntRect rectForHorizontalScrollbar(const IntRect& borderBoxRect) const;
216 IntRect rectForVerticalScrollbar(const IntRect& borderBoxRect) const; 223 IntRect rectForVerticalScrollbar(const IntRect& borderBoxRect) const;
217 224
225 DECLARE_VIRTUAL_TRACE();
226
218 private: 227 private:
228 explicit DeprecatedPaintLayerScrollableArea(DeprecatedPaintLayer&);
229
219 bool hasHorizontalOverflow() const; 230 bool hasHorizontalOverflow() const;
220 bool hasVerticalOverflow() const; 231 bool hasVerticalOverflow() const;
221 bool hasScrollableHorizontalOverflow() const; 232 bool hasScrollableHorizontalOverflow() const;
222 bool hasScrollableVerticalOverflow() const; 233 bool hasScrollableVerticalOverflow() const;
223 234
224 void computeScrollDimensions(); 235 void computeScrollDimensions();
225 236
226 // TODO(bokan): This method hides the base class version and is subtly diffe rent. 237 // TODO(bokan): This method hides the base class version and is subtly diffe rent.
227 // Should be unified. 238 // Should be unified.
228 DoubleSize clampScrollOffset(const DoubleSize&) const; 239 DoubleSize clampScrollOffset(const DoubleSize&) const;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 280
270 // The width/height of our scrolled area. 281 // The width/height of our scrolled area.
271 LayoutRect m_overflowRect; 282 LayoutRect m_overflowRect;
272 283
273 // This is the (scroll) offset from scrollOrigin(). 284 // This is the (scroll) offset from scrollOrigin().
274 DoubleSize m_scrollOffset; 285 DoubleSize m_scrollOffset;
275 286
276 IntPoint m_cachedOverlayScrollbarOffset; 287 IntPoint m_cachedOverlayScrollbarOffset;
277 288
278 // For areas with overflow, we have a pair of scrollbars. 289 // For areas with overflow, we have a pair of scrollbars.
279 RefPtrWillBePersistent<Scrollbar> m_hBar; 290 RefPtrWillBeMember<Scrollbar> m_hBar;
280 RefPtrWillBePersistent<Scrollbar> m_vBar; 291 RefPtrWillBeMember<Scrollbar> m_vBar;
281 292
282 // LayoutObject to hold our custom scroll corner. 293 // LayoutObject to hold our custom scroll corner.
283 LayoutScrollbarPart* m_scrollCorner; 294 LayoutScrollbarPart* m_scrollCorner;
284 295
285 // LayoutObject to hold our custom resizer. 296 // LayoutObject to hold our custom resizer.
286 LayoutScrollbarPart* m_resizer; 297 LayoutScrollbarPart* m_resizer;
298
299 #if ENABLE(ASSERT)
300 bool m_hasBeenDisposed;
301 #endif
287 }; 302 };
288 303
289 } // namespace blink 304 } // namespace blink
290 305
291 #endif // LayerScrollableArea_h 306 #endif // LayerScrollableArea_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698