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/layer_impl.h" | 9 #include "cc/layer_impl.h" |
10 #include "cc/scrollbar_geometry_fixed_thumb.h" | 10 #include "cc/scrollbar_geometry_fixed_thumb.h" |
11 #include <public/WebRect.h> | 11 #include <public/WebRect.h> |
12 #include <public/WebScrollbar.h> | 12 #include <public/WebScrollbar.h> |
13 #include <public/WebVector.h> | 13 #include <public/WebVector.h> |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 | 16 |
17 class ScrollView; | 17 class ScrollView; |
18 | 18 |
19 class CC_EXPORT ScrollbarLayerImpl : public LayerImpl { | 19 class CC_EXPORT ScrollbarLayerImpl : public LayerImpl { |
20 public: | 20 public: |
21 static scoped_ptr<ScrollbarLayerImpl> create(LayerTreeHostImpl* hostImpl, in
t id); | 21 static scoped_ptr<ScrollbarLayerImpl> create(LayerTreeImpl* treeImpl, int id
); |
22 virtual ~ScrollbarLayerImpl(); | 22 virtual ~ScrollbarLayerImpl(); |
23 | 23 |
24 ScrollbarGeometryFixedThumb* scrollbarGeometry() const { return m_geometry.g
et(); } | 24 ScrollbarGeometryFixedThumb* scrollbarGeometry() const { return m_geometry.g
et(); } |
25 void setScrollbarGeometry(scoped_ptr<ScrollbarGeometryFixedThumb>); | 25 void setScrollbarGeometry(scoped_ptr<ScrollbarGeometryFixedThumb>); |
26 void setScrollbarData(WebKit::WebScrollbar*); | 26 void setScrollbarData(WebKit::WebScrollbar*); |
27 | 27 |
28 void setBackTrackResourceId(ResourceProvider::ResourceId id) { m_backTrackRe
sourceId = id; } | 28 void setBackTrackResourceId(ResourceProvider::ResourceId id) { m_backTrackRe
sourceId = id; } |
29 void setForeTrackResourceId(ResourceProvider::ResourceId id) { m_foreTrackRe
sourceId = id; } | 29 void setForeTrackResourceId(ResourceProvider::ResourceId id) { m_foreTrackRe
sourceId = id; } |
30 void setThumbResourceId(ResourceProvider::ResourceId id) { m_thumbResourceId
= id; } | 30 void setThumbResourceId(ResourceProvider::ResourceId id) { m_thumbResourceId
= id; } |
31 | 31 |
32 float currentPos() const { return m_currentPos; } | 32 float currentPos() const { return m_currentPos; } |
33 void setCurrentPos(float currentPos) { m_currentPos = currentPos; } | 33 void setCurrentPos(float currentPos) { m_currentPos = currentPos; } |
34 | 34 |
35 int totalSize() const { return m_totalSize; } | 35 int totalSize() const { return m_totalSize; } |
36 void setTotalSize(int totalSize) { m_totalSize = totalSize; } | 36 void setTotalSize(int totalSize) { m_totalSize = totalSize; } |
37 | 37 |
38 int maximum() const { return m_maximum; } | 38 int maximum() const { return m_maximum; } |
39 void setMaximum(int maximum) { m_maximum = maximum; } | 39 void setMaximum(int maximum) { m_maximum = maximum; } |
40 | 40 |
41 WebKit::WebScrollbar::Orientation orientation() const { return m_orientation
; } | 41 WebKit::WebScrollbar::Orientation orientation() const { return m_orientation
; } |
42 | 42 |
43 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; | 43 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; |
44 | 44 |
45 virtual void didLoseOutputSurface() OVERRIDE; | 45 virtual void didLoseOutputSurface() OVERRIDE; |
46 | 46 |
47 protected: | 47 protected: |
48 ScrollbarLayerImpl(LayerTreeHostImpl* hostImpl, int id); | 48 ScrollbarLayerImpl(LayerTreeImpl* treeImpl, int id); |
49 | 49 |
50 private: | 50 private: |
51 // nested class only to avoid namespace problem | 51 // nested class only to avoid namespace problem |
52 class Scrollbar : public WebKit::WebScrollbar { | 52 class Scrollbar : public WebKit::WebScrollbar { |
53 public: | 53 public: |
54 explicit Scrollbar(ScrollbarLayerImpl* owner) : m_owner(owner) { } | 54 explicit Scrollbar(ScrollbarLayerImpl* owner) : m_owner(owner) { } |
55 | 55 |
56 // WebScrollbar implementation | 56 // WebScrollbar implementation |
57 virtual bool isOverlay() const; | 57 virtual bool isOverlay() const; |
58 virtual int value() const; | 58 virtual int value() const; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 bool m_isScrollableAreaActive; | 103 bool m_isScrollableAreaActive; |
104 bool m_isScrollViewScrollbar; | 104 bool m_isScrollViewScrollbar; |
105 bool m_enabled; | 105 bool m_enabled; |
106 bool m_isCustomScrollbar; | 106 bool m_isCustomScrollbar; |
107 bool m_isOverlayScrollbar; | 107 bool m_isOverlayScrollbar; |
108 }; | 108 }; |
109 | 109 |
110 } | 110 } |
111 #endif // CC_SCROLLBAR_LAYER_IMPL_H_ | 111 #endif // CC_SCROLLBAR_LAYER_IMPL_H_ |
OLD | NEW |