| 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_TEST_FAKE_SCROLLBAR_H_ | 5 #ifndef CC_TEST_FAKE_SCROLLBAR_H_ |
| 6 #define CC_TEST_FAKE_SCROLLBAR_H_ | 6 #define CC_TEST_FAKE_SCROLLBAR_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "cc/input/scrollbar.h" | 10 #include "cc/input/scrollbar.h" |
| 11 #include "third_party/skia/include/core/SkColor.h" | 11 #include "third_party/skia/include/core/SkColor.h" |
| 12 | 12 |
| 13 namespace cc { | 13 namespace cc { |
| 14 | 14 |
| 15 class FakeScrollbar : public Scrollbar { | 15 class FakeScrollbar : public Scrollbar { |
| 16 public: | 16 public: |
| 17 FakeScrollbar(); | 17 FakeScrollbar(); |
| 18 FakeScrollbar(bool paint, bool has_thumb, bool is_overlay); | 18 FakeScrollbar(bool paint, bool has_thumb, bool is_overlay); |
| 19 FakeScrollbar(bool paint, |
| 20 bool has_thumb, |
| 21 ScrollbarOrientation orientation, |
| 22 bool is_left_side_vertical_scrollbar, |
| 23 bool is_overlay); |
| 19 ~FakeScrollbar() override; | 24 ~FakeScrollbar() override; |
| 20 | 25 |
| 21 // Scrollbar implementation. | 26 // Scrollbar implementation. |
| 22 ScrollbarOrientation Orientation() const override; | 27 ScrollbarOrientation Orientation() const override; |
| 23 bool IsLeftSideVerticalScrollbar() const override; | 28 bool IsLeftSideVerticalScrollbar() const override; |
| 24 gfx::Point Location() const override; | 29 gfx::Point Location() const override; |
| 25 bool IsOverlay() const override; | 30 bool IsOverlay() const override; |
| 26 bool HasThumb() const override; | 31 bool HasThumb() const override; |
| 27 int ThumbThickness() const override; | 32 int ThumbThickness() const override; |
| 28 int ThumbLength() const override; | 33 int ThumbLength() const override; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 46 void set_needs_paint_thumb(bool needs_paint) { | 51 void set_needs_paint_thumb(bool needs_paint) { |
| 47 needs_paint_thumb_ = needs_paint; | 52 needs_paint_thumb_ = needs_paint; |
| 48 } | 53 } |
| 49 void set_needs_paint_track(bool needs_paint) { | 54 void set_needs_paint_track(bool needs_paint) { |
| 50 needs_paint_track_ = needs_paint; | 55 needs_paint_track_ = needs_paint; |
| 51 } | 56 } |
| 52 | 57 |
| 53 private: | 58 private: |
| 54 bool paint_; | 59 bool paint_; |
| 55 bool has_thumb_; | 60 bool has_thumb_; |
| 61 ScrollbarOrientation orientation_; |
| 62 bool is_left_side_vertical_scrollbar_; |
| 56 bool is_overlay_; | 63 bool is_overlay_; |
| 57 int thumb_thickness_; | 64 int thumb_thickness_; |
| 58 int thumb_length_; | 65 int thumb_length_; |
| 59 float thumb_opacity_; | 66 float thumb_opacity_; |
| 60 bool needs_paint_thumb_; | 67 bool needs_paint_thumb_; |
| 61 bool needs_paint_track_; | 68 bool needs_paint_track_; |
| 62 gfx::Point location_; | 69 gfx::Point location_; |
| 63 gfx::Rect track_rect_; | 70 gfx::Rect track_rect_; |
| 64 SkColor fill_color_; | 71 SkColor fill_color_; |
| 65 | 72 |
| 66 DISALLOW_COPY_AND_ASSIGN(FakeScrollbar); | 73 DISALLOW_COPY_AND_ASSIGN(FakeScrollbar); |
| 67 }; | 74 }; |
| 68 | 75 |
| 69 } // namespace cc | 76 } // namespace cc |
| 70 | 77 |
| 71 #endif // CC_TEST_FAKE_SCROLLBAR_H_ | 78 #endif // CC_TEST_FAKE_SCROLLBAR_H_ |
| OLD | NEW |