| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_BLINK_SCROLLBAR_IMPL_H_ | 5 #ifndef CC_BLINK_SCROLLBAR_IMPL_H_ |
| 6 #define CC_BLINK_SCROLLBAR_IMPL_H_ | 6 #define CC_BLINK_SCROLLBAR_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "cc/input/scrollbar.h" | 11 #include "cc/input/scrollbar.h" |
| 12 #include "cc/paint/paint_canvas.h" |
| 12 #include "third_party/WebKit/public/platform/WebScrollbarThemePainter.h" | 13 #include "third_party/WebKit/public/platform/WebScrollbarThemePainter.h" |
| 13 | 14 |
| 14 namespace blink { | 15 namespace blink { |
| 15 class WebScrollbar; | 16 class WebScrollbar; |
| 16 class WebScrollbarThemeGeometry; | 17 class WebScrollbarThemeGeometry; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace cc_blink { | 20 namespace cc_blink { |
| 20 | 21 |
| 21 class ScrollbarImpl : public cc::Scrollbar { | 22 class ScrollbarImpl : public cc::Scrollbar { |
| 22 public: | 23 public: |
| 23 ScrollbarImpl(std::unique_ptr<blink::WebScrollbar> scrollbar, | 24 ScrollbarImpl(std::unique_ptr<blink::WebScrollbar> scrollbar, |
| 24 blink::WebScrollbarThemePainter painter, | 25 blink::WebScrollbarThemePainter painter, |
| 25 std::unique_ptr<blink::WebScrollbarThemeGeometry> geometry); | 26 std::unique_ptr<blink::WebScrollbarThemeGeometry> geometry); |
| 26 ~ScrollbarImpl() override; | 27 ~ScrollbarImpl() override; |
| 27 | 28 |
| 28 // cc::Scrollbar implementation. | 29 // cc::Scrollbar implementation. |
| 29 cc::ScrollbarOrientation Orientation() const override; | 30 cc::ScrollbarOrientation Orientation() const override; |
| 30 bool IsLeftSideVerticalScrollbar() const override; | 31 bool IsLeftSideVerticalScrollbar() const override; |
| 31 bool HasThumb() const override; | 32 bool HasThumb() const override; |
| 32 bool IsOverlay() const override; | 33 bool IsOverlay() const override; |
| 33 gfx::Point Location() const override; | 34 gfx::Point Location() const override; |
| 34 int ThumbThickness() const override; | 35 int ThumbThickness() const override; |
| 35 int ThumbLength() const override; | 36 int ThumbLength() const override; |
| 36 gfx::Rect TrackRect() const override; | 37 gfx::Rect TrackRect() const override; |
| 37 float ThumbOpacity() const override; | 38 float ThumbOpacity() const override; |
| 38 bool NeedsPaintPart(cc::ScrollbarPart part) const override; | 39 bool NeedsPaintPart(cc::ScrollbarPart part) const override; |
| 39 void PaintPart(SkCanvas* canvas, | 40 void PaintPart(cc::PaintCanvas* canvas, |
| 40 cc::ScrollbarPart part, | 41 cc::ScrollbarPart part, |
| 41 const gfx::Rect& content_rect) override; | 42 const gfx::Rect& content_rect) override; |
| 42 | 43 |
| 43 private: | 44 private: |
| 44 std::unique_ptr<blink::WebScrollbar> scrollbar_; | 45 std::unique_ptr<blink::WebScrollbar> scrollbar_; |
| 45 blink::WebScrollbarThemePainter painter_; | 46 blink::WebScrollbarThemePainter painter_; |
| 46 std::unique_ptr<blink::WebScrollbarThemeGeometry> geometry_; | 47 std::unique_ptr<blink::WebScrollbarThemeGeometry> geometry_; |
| 47 | 48 |
| 48 DISALLOW_COPY_AND_ASSIGN(ScrollbarImpl); | 49 DISALLOW_COPY_AND_ASSIGN(ScrollbarImpl); |
| 49 }; | 50 }; |
| 50 | 51 |
| 51 } // namespace cc_blink | 52 } // namespace cc_blink |
| 52 | 53 |
| 53 #endif // CC_BLINK_SCROLLBAR_IMPL_H_ | 54 #endif // CC_BLINK_SCROLLBAR_IMPL_H_ |
| OLD | NEW |