| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_SCROLLBAR_LAYER_IMPL_H_ | 5 #ifndef CC_SCROLLBAR_LAYER_IMPL_H_ |
| 6 #define CC_SCROLLBAR_LAYER_IMPL_H_ | 6 #define CC_SCROLLBAR_LAYER_IMPL_H_ |
| 7 | 7 |
| 8 #include "cc/cc_export.h" | 8 #include "cc/cc_export.h" |
| 9 #include "cc/scrollbar_geometry_fixed_thumb.h" | 9 #include "cc/scrollbar_geometry_fixed_thumb.h" |
| 10 #include "cc/scrollbar_layer_impl_base.h" | 10 #include "cc/scrollbar_layer_impl_base.h" |
| 11 #include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h" | 11 #include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h" |
| 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebVector.h" | 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebVector.h" |
| 13 | 13 |
| 14 namespace cc { | 14 namespace cc { |
| 15 | 15 |
| 16 class ScrollView; | 16 class ScrollView; |
| 17 | 17 |
| 18 class CC_EXPORT ScrollbarLayerImpl : public ScrollbarLayerImplBase { | 18 class CC_EXPORT ScrollbarLayerImpl : public ScrollbarLayerImplBase { |
| 19 public: | 19 public: |
| 20 static scoped_ptr<ScrollbarLayerImpl> create(LayerTreeImpl* treeImpl, int id
); | 20 static scoped_ptr<ScrollbarLayerImpl> create(LayerTreeImpl* treeImpl, int id
); |
| 21 virtual ~ScrollbarLayerImpl(); | 21 virtual ~ScrollbarLayerImpl(); |
| 22 | 22 |
| 23 virtual ScrollbarLayerImpl* toScrollbarLayer() OVERRIDE; |
| 24 int scrollLayerId() const { return m_scrollLayerId; } |
| 25 void setScrollLayerId(int id) { m_scrollLayerId = id; } |
| 26 |
| 23 ScrollbarGeometryFixedThumb* scrollbarGeometry() const { return m_geometry.g
et(); } | 27 ScrollbarGeometryFixedThumb* scrollbarGeometry() const { return m_geometry.g
et(); } |
| 24 void setScrollbarGeometry(scoped_ptr<ScrollbarGeometryFixedThumb>); | 28 void setScrollbarGeometry(scoped_ptr<ScrollbarGeometryFixedThumb>); |
| 25 void setScrollbarData(WebKit::WebScrollbar*); | 29 void setScrollbarData(WebKit::WebScrollbar*); |
| 26 | 30 |
| 27 void setBackTrackResourceId(ResourceProvider::ResourceId id) { m_backTrackRe
sourceId = id; } | 31 void setBackTrackResourceId(ResourceProvider::ResourceId id) { m_backTrackRe
sourceId = id; } |
| 28 void setForeTrackResourceId(ResourceProvider::ResourceId id) { m_foreTrackRe
sourceId = id; } | 32 void setForeTrackResourceId(ResourceProvider::ResourceId id) { m_foreTrackRe
sourceId = id; } |
| 29 void setThumbResourceId(ResourceProvider::ResourceId id) { m_thumbResourceId
= id; } | 33 void setThumbResourceId(ResourceProvider::ResourceId id) { m_thumbResourceId
= id; } |
| 30 | 34 |
| 31 void setOwningLayer(LayerImpl* owningLayer); | |
| 32 | 35 |
| 33 // ScrollbarLayerImplBase implementation. | 36 // ScrollbarLayerImplBase implementation. |
| 34 virtual float currentPos() const OVERRIDE; | 37 virtual float currentPos() const OVERRIDE; |
| 35 virtual int totalSize() const OVERRIDE; | 38 virtual int totalSize() const OVERRIDE; |
| 36 virtual int maximum() const OVERRIDE; | 39 virtual int maximum() const OVERRIDE; |
| 37 | 40 |
| 38 void setCurrentPos(float currentPos) { m_currentPos = currentPos; } | 41 void setCurrentPos(float currentPos) { m_currentPos = currentPos; } |
| 39 void setTotalSize(int totalSize) { m_totalSize = totalSize; } | 42 void setTotalSize(int totalSize) { m_totalSize = totalSize; } |
| 40 void setMaximum(int maximum) { m_maximum = maximum; } | 43 void setMaximum(int maximum) { m_maximum = maximum; } |
| 41 | 44 |
| 42 virtual WebKit::WebScrollbar::Orientation orientation() const OVERRIDE; | 45 virtual WebKit::WebScrollbar::Orientation orientation() const OVERRIDE; |
| 43 | 46 |
| 47 virtual scoped_ptr<LayerImpl> createLayerImpl(LayerTreeImpl*) OVERRIDE; |
| 48 virtual void pushPropertiesTo(LayerImpl*) OVERRIDE; |
| 49 |
| 44 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; | 50 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; |
| 45 | 51 |
| 46 virtual void didLoseOutputSurface() OVERRIDE; | 52 virtual void didLoseOutputSurface() OVERRIDE; |
| 47 | 53 |
| 48 protected: | 54 protected: |
| 49 ScrollbarLayerImpl(LayerTreeImpl* treeImpl, int id); | 55 ScrollbarLayerImpl(LayerTreeImpl* treeImpl, int id); |
| 50 | 56 |
| 51 private: | 57 private: |
| 52 // nested class only to avoid namespace problem | 58 // nested class only to avoid namespace problem |
| 53 class Scrollbar : public WebKit::WebScrollbar { | 59 class Scrollbar : public WebKit::WebScrollbar { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 ResourceProvider::ResourceId m_backTrackResourceId; | 92 ResourceProvider::ResourceId m_backTrackResourceId; |
| 87 ResourceProvider::ResourceId m_foreTrackResourceId; | 93 ResourceProvider::ResourceId m_foreTrackResourceId; |
| 88 ResourceProvider::ResourceId m_thumbResourceId; | 94 ResourceProvider::ResourceId m_thumbResourceId; |
| 89 | 95 |
| 90 scoped_ptr<ScrollbarGeometryFixedThumb> m_geometry; | 96 scoped_ptr<ScrollbarGeometryFixedThumb> m_geometry; |
| 91 | 97 |
| 92 float m_currentPos; | 98 float m_currentPos; |
| 93 int m_totalSize; | 99 int m_totalSize; |
| 94 int m_maximum; | 100 int m_maximum; |
| 95 | 101 |
| 102 int m_scrollLayerId; |
| 103 |
| 96 // Data to implement Scrollbar | 104 // Data to implement Scrollbar |
| 97 WebKit::WebScrollbar::ScrollbarOverlayStyle m_scrollbarOverlayStyle; | 105 WebKit::WebScrollbar::ScrollbarOverlayStyle m_scrollbarOverlayStyle; |
| 98 WebKit::WebVector<WebKit::WebRect> m_tickmarks; | 106 WebKit::WebVector<WebKit::WebRect> m_tickmarks; |
| 99 WebKit::WebScrollbar::Orientation m_orientation; | 107 WebKit::WebScrollbar::Orientation m_orientation; |
| 100 WebKit::WebScrollbar::ScrollbarControlSize m_controlSize; | 108 WebKit::WebScrollbar::ScrollbarControlSize m_controlSize; |
| 101 WebKit::WebScrollbar::ScrollbarPart m_pressedPart; | 109 WebKit::WebScrollbar::ScrollbarPart m_pressedPart; |
| 102 WebKit::WebScrollbar::ScrollbarPart m_hoveredPart; | 110 WebKit::WebScrollbar::ScrollbarPart m_hoveredPart; |
| 103 | 111 |
| 104 bool m_isScrollableAreaActive; | 112 bool m_isScrollableAreaActive; |
| 105 bool m_isScrollViewScrollbar; | 113 bool m_isScrollViewScrollbar; |
| 106 bool m_enabled; | 114 bool m_enabled; |
| 107 bool m_isCustomScrollbar; | 115 bool m_isCustomScrollbar; |
| 108 bool m_isOverlayScrollbar; | 116 bool m_isOverlayScrollbar; |
| 109 }; | 117 }; |
| 110 | 118 |
| 111 } | 119 } |
| 112 #endif // CC_SCROLLBAR_LAYER_IMPL_H_ | 120 #endif // CC_SCROLLBAR_LAYER_IMPL_H_ |
| OLD | NEW |