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

Side by Side Diff: Source/core/frame/PinchViewport.h

Issue 199253002: Made PinchViewport a ScrollableArea (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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
« no previous file with comments | « no previous file | Source/core/frame/PinchViewport.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 15 matching lines...) Expand all
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef PinchViewport_h 31 #ifndef PinchViewport_h
32 #define PinchViewport_h 32 #define PinchViewport_h
33 33
34 #include "platform/geometry/IntSize.h" 34 #include "platform/geometry/IntSize.h"
35 #include "platform/graphics/GraphicsLayerClient.h" 35 #include "platform/graphics/GraphicsLayerClient.h"
36 #include "platform/scroll/ScrollableArea.h"
36 #include "public/platform/WebScrollbar.h" 37 #include "public/platform/WebScrollbar.h"
37 #include "public/platform/WebSize.h" 38 #include "public/platform/WebSize.h"
38 #include "wtf/OwnPtr.h" 39 #include "wtf/OwnPtr.h"
39 #include "wtf/PassOwnPtr.h" 40 #include "wtf/PassOwnPtr.h"
40 41
41 namespace blink { 42 namespace blink {
42 class WebLayerTreeView; 43 class WebLayerTreeView;
43 class WebScrollbarLayer; 44 class WebScrollbarLayer;
44 } 45 }
45 46
46 namespace WebCore { 47 namespace WebCore {
47 48
48 class FrameHost; 49 class FrameHost;
49 class GraphicsContext; 50 class GraphicsContext;
50 class GraphicsLayer; 51 class GraphicsLayer;
51 class GraphicsLayerFactory; 52 class GraphicsLayerFactory;
52 class IntRect; 53 class IntRect;
53 class IntSize; 54 class IntSize;
54 55
55 class PinchViewport FINAL : WebCore::GraphicsLayerClient { 56 class PinchViewport FINAL : public GraphicsLayerClient, public ScrollableArea {
56 public: 57 public:
57 PinchViewport(FrameHost&); 58 PinchViewport(FrameHost&);
58 virtual ~PinchViewport(); 59 virtual ~PinchViewport();
59 60
60 void attachToLayerTree(WebCore::GraphicsLayer*, GraphicsLayerFactory*); 61 void attachToLayerTree(GraphicsLayer*, GraphicsLayerFactory*);
61 WebCore::GraphicsLayer* rootGraphicsLayer() 62 GraphicsLayer* rootGraphicsLayer()
62 { 63 {
63 return m_innerViewportContainerLayer.get(); 64 return m_innerViewportContainerLayer.get();
64 } 65 }
65 void setViewportSize(const WebCore::IntSize&);
66 66
67 void registerViewportLayersWithTreeView(blink::WebLayerTreeView*) const; 67 void setLocation(const IntPoint&);
68 void clearViewportLayersForTreeView(blink::WebLayerTreeView*) const; 68 void setSize(const IntSize&);
69 69
70 void registerLayersWithTreeView(blink::WebLayerTreeView*) const;
71 void clearLayersForTreeView(blink::WebLayerTreeView*) const;
72
73 IntRect visibleRect() const { return m_visibleRect; }
70 private: 74 private:
75 // ScrollableArea implementation
76 virtual bool isActive() const OVERRIDE { return false; }
77 virtual int scrollSize(ScrollbarOrientation) const OVERRIDE;
78 virtual bool isScrollCornerVisible() const OVERRIDE { return false; }
79 virtual IntRect scrollCornerRect() const OVERRIDE { return IntRect(); }
80 virtual IntPoint scrollPosition() const OVERRIDE { return visibleRect().loca tion(); }
81 virtual IntPoint minimumScrollPosition() const OVERRIDE;
82 virtual IntPoint maximumScrollPosition() const OVERRIDE;
83 virtual int visibleHeight() const OVERRIDE { return visibleRect().height(); };
84 virtual int visibleWidth() const OVERRIDE { return visibleRect().width(); };
85 virtual IntSize contentsSize() const OVERRIDE;
86 virtual bool scrollbarsCanBeActive() const OVERRIDE { return false; }
87 virtual IntRect scrollableAreaBoundingBox() const OVERRIDE;
88 virtual bool userInputScrollable(ScrollbarOrientation) const OVERRIDE { retu rn true; }
89 virtual bool shouldPlaceVerticalScrollbarOnLeft() const OVERRIDE { return fa lse; }
90 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) OVERRIDE;
91 virtual void invalidateScrollCornerRect(const IntRect&) OVERRIDE { }
92 virtual void setScrollOffset(const IntPoint&) OVERRIDE;
93 virtual GraphicsLayer* layerForContainer() const OVERRIDE;
94 virtual GraphicsLayer* layerForScrolling() const OVERRIDE;
95 virtual GraphicsLayer* layerForHorizontalScrollbar() const OVERRIDE;
96 virtual GraphicsLayer* layerForVerticalScrollbar() const OVERRIDE;
71 97
72 // GraphicsLayerClient implementation. 98 // GraphicsLayerClient implementation.
73 virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double mo notonicTime) OVERRIDE; 99 virtual void notifyAnimationStarted(const GraphicsLayer*, double monotonicTi me) OVERRIDE;
74 virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsC ontext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& inClip) OV ERRIDE; 100 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsL ayerPaintingPhase, const IntRect& inClip) OVERRIDE;
75 virtual String debugName(const WebCore::GraphicsLayer*) OVERRIDE; 101 virtual String debugName(const GraphicsLayer*) OVERRIDE;
76 102
77 void setupScrollbar(blink::WebScrollbar::Orientation); 103 void setupScrollbar(blink::WebScrollbar::Orientation);
78 104
79 WebCore::FrameHost& m_owner; 105 FrameHost& m_frameHost;
80 OwnPtr<WebCore::GraphicsLayer> m_innerViewportContainerLayer; 106 OwnPtr<GraphicsLayer> m_innerViewportContainerLayer;
81 OwnPtr<WebCore::GraphicsLayer> m_pageScaleLayer; 107 OwnPtr<GraphicsLayer> m_pageScaleLayer;
82 OwnPtr<WebCore::GraphicsLayer> m_innerViewportScrollLayer; 108 OwnPtr<GraphicsLayer> m_innerViewportScrollLayer;
83 OwnPtr<WebCore::GraphicsLayer> m_overlayScrollbarHorizontal; 109 OwnPtr<GraphicsLayer> m_overlayScrollbarHorizontal;
84 OwnPtr<WebCore::GraphicsLayer> m_overlayScrollbarVertical; 110 OwnPtr<GraphicsLayer> m_overlayScrollbarVertical;
85 OwnPtr<blink::WebScrollbarLayer> m_webOverlayScrollbarHorizontal; 111 OwnPtr<blink::WebScrollbarLayer> m_webOverlayScrollbarHorizontal;
86 OwnPtr<blink::WebScrollbarLayer> m_webOverlayScrollbarVertical; 112 OwnPtr<blink::WebScrollbarLayer> m_webOverlayScrollbarVertical;
113
114 IntRect m_visibleRect;
87 }; 115 };
88 116
89 } // namespace WebCore 117 } // namespace WebCore
90 118
91 #endif // PinchViewport_h 119 #endif // PinchViewport_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/frame/PinchViewport.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698