OLD | NEW |
1 // Copyright 2013 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_INPUT_SCROLLBAR_H_ | 5 #ifndef CC_INPUT_SCROLLBAR_H_ |
6 #define CC_INPUT_SCROLLBAR_H_ | 6 #define CC_INPUT_SCROLLBAR_H_ |
7 | 7 |
8 #include "cc/base/cc_export.h" | 8 #include "cc/base/cc_export.h" |
| 9 #include "cc/paint/paint_canvas.h" |
9 #include "ui/gfx/geometry/point.h" | 10 #include "ui/gfx/geometry/point.h" |
10 #include "ui/gfx/geometry/rect.h" | 11 #include "ui/gfx/geometry/rect.h" |
11 | 12 |
12 class SkCanvas; | |
13 | |
14 namespace cc { | 13 namespace cc { |
15 | 14 |
16 enum ScrollbarOrientation { HORIZONTAL, VERTICAL }; | 15 enum ScrollbarOrientation { HORIZONTAL, VERTICAL }; |
17 enum ScrollDirection { SCROLL_BACKWARD, SCROLL_FORWARD }; | 16 enum ScrollDirection { SCROLL_BACKWARD, SCROLL_FORWARD }; |
18 // For now, TRACK includes everything but the thumb including background and | 17 // For now, TRACK includes everything but the thumb including background and |
19 // buttons. | 18 // buttons. |
20 enum ScrollbarPart { THUMB, TRACK }; | 19 enum ScrollbarPart { THUMB, TRACK }; |
21 | 20 |
22 class Scrollbar { | 21 class Scrollbar { |
23 public: | 22 public: |
24 virtual ~Scrollbar() {} | 23 virtual ~Scrollbar() {} |
25 | 24 |
26 virtual ScrollbarOrientation Orientation() const = 0; | 25 virtual ScrollbarOrientation Orientation() const = 0; |
27 virtual bool IsLeftSideVerticalScrollbar() const = 0; | 26 virtual bool IsLeftSideVerticalScrollbar() const = 0; |
28 virtual gfx::Point Location() const = 0; | 27 virtual gfx::Point Location() const = 0; |
29 virtual bool IsOverlay() const = 0; | 28 virtual bool IsOverlay() const = 0; |
30 virtual bool HasThumb() const = 0; | 29 virtual bool HasThumb() const = 0; |
31 virtual int ThumbThickness() const = 0; | 30 virtual int ThumbThickness() const = 0; |
32 virtual int ThumbLength() const = 0; | 31 virtual int ThumbLength() const = 0; |
33 virtual gfx::Rect TrackRect() const = 0; | 32 virtual gfx::Rect TrackRect() const = 0; |
34 virtual float ThumbOpacity() const = 0; | 33 virtual float ThumbOpacity() const = 0; |
35 virtual bool NeedsPaintPart(ScrollbarPart part) const = 0; | 34 virtual bool NeedsPaintPart(ScrollbarPart part) const = 0; |
36 virtual void PaintPart(SkCanvas* canvas, | 35 virtual void PaintPart(PaintCanvas* canvas, |
37 ScrollbarPart part, | 36 ScrollbarPart part, |
38 const gfx::Rect& content_rect) = 0; | 37 const gfx::Rect& content_rect) = 0; |
39 }; | 38 }; |
40 | 39 |
41 } // namespace cc | 40 } // namespace cc |
42 | 41 |
43 #endif // CC_INPUT_SCROLLBAR_H_ | 42 #endif // CC_INPUT_SCROLLBAR_H_ |
OLD | NEW |