OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_TEST_FAKE_SCROLLBAR_H_ | 5 #ifndef CC_INPUT_VIEWPORT_SCROLLBAR_H_ |
6 #define CC_TEST_FAKE_SCROLLBAR_H_ | 6 #define CC_INPUT_VIEWPORT_SCROLLBAR_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "cc/base/cc_export.h" |
9 #include "cc/input/scrollbar.h" | 10 #include "cc/input/scrollbar.h" |
10 #include "third_party/skia/include/core/SkColor.h" | 11 #include "ui/gfx/point.h" |
| 12 #include "ui/gfx/rect.h" |
11 | 13 |
12 namespace cc { | 14 namespace cc { |
13 | 15 |
14 class FakeScrollbar : public Scrollbar { | 16 class Layer; |
| 17 |
| 18 class CC_EXPORT ViewportScrollbar : public Scrollbar { |
15 public: | 19 public: |
16 FakeScrollbar(); | 20 ViewportScrollbar(scoped_refptr<Layer> scroll_layer, |
17 FakeScrollbar(bool paint, bool has_thumb, bool is_overlay); | 21 ScrollbarOrientation orientation, |
18 virtual ~FakeScrollbar(); | 22 size_t thickness); |
| 23 virtual ~ViewportScrollbar(); |
19 | 24 |
20 // Scrollbar implementation. | |
21 virtual ScrollbarOrientation Orientation() const OVERRIDE; | 25 virtual ScrollbarOrientation Orientation() const OVERRIDE; |
22 virtual gfx::Point Location() const OVERRIDE; | 26 virtual gfx::Point Location() const OVERRIDE; |
23 virtual bool IsOverlay() const OVERRIDE; | 27 virtual bool IsOverlay() const OVERRIDE; |
24 virtual bool HasThumb() const OVERRIDE; | 28 virtual bool HasThumb() const OVERRIDE; |
25 virtual int ThumbThickness() const OVERRIDE; | 29 virtual int ThumbThickness() const OVERRIDE; |
26 virtual int ThumbLength() const OVERRIDE; | 30 virtual int ThumbLength() const OVERRIDE; |
27 virtual gfx::Rect TrackRect() const OVERRIDE; | 31 virtual gfx::Rect TrackRect() const OVERRIDE; |
28 virtual void PaintPart(SkCanvas* canvas, | 32 virtual void PaintPart(SkCanvas* canvas, |
29 ScrollbarPart part, | 33 ScrollbarPart part, |
30 gfx::Rect content_rect) OVERRIDE; | 34 gfx::Rect content_rect) OVERRIDE; |
31 | 35 |
32 void set_location(gfx::Point location) { location_ = location; } | |
33 | |
34 private: | 36 private: |
35 bool paint_; | 37 scoped_refptr<Layer> scroll_layer_; |
36 bool has_thumb_; | 38 ScrollbarOrientation orientation_; |
37 bool is_overlay_; | 39 const size_t thickness_; |
38 gfx::Point location_; | |
39 SkColor fill_color_; | |
40 | |
41 DISALLOW_COPY_AND_ASSIGN(FakeScrollbar); | |
42 }; | 40 }; |
43 | 41 |
44 } // namespace cc | 42 } // namespace cc |
45 | 43 |
46 #endif // CC_TEST_FAKE_SCROLLBAR_H_ | 44 #endif // CC_INPUT_VIEWPORT_SCROLLBAR_H_ |
OLD | NEW |