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
3 // found in the LICENSE file.
5 #ifndef CC_TEST_FAKE_SCROLLBAR_H_
6 #define CC_TEST_FAKE_SCROLLBAR_H_
8 #include "base/compiler_specific.h"
9 #include "cc/input/scrollbar.h"
10 #include "third_party/skia/include/core/SkColor.h"
14 class FakeScrollbar
: public Scrollbar
{
17 FakeScrollbar(bool paint
, bool has_thumb
, bool is_overlay
);
18 ~FakeScrollbar() override
;
20 // Scrollbar implementation.
21 ScrollbarOrientation
Orientation() const override
;
22 bool IsLeftSideVerticalScrollbar() const override
;
23 gfx::Point
Location() const override
;
24 bool IsOverlay() const override
;
25 bool HasThumb() const override
;
26 int ThumbThickness() const override
;
27 int ThumbLength() const override
;
28 gfx::Rect
TrackRect() const override
;
29 void PaintPart(SkCanvas
* canvas
,
31 const gfx::Rect
& content_rect
) override
;
33 void set_location(const gfx::Point
& location
) { location_
= location
; }
34 void set_track_rect(const gfx::Rect
& track_rect
) { track_rect_
= track_rect
; }
35 void set_thumb_thickness(int thumb_thickness
) {
36 thumb_thickness_
= thumb_thickness
;
38 void set_thumb_length(int thumb_length
) { thumb_length_
= thumb_length
; }
39 void set_has_thumb(bool has_thumb
) { has_thumb_
= has_thumb
; }
40 SkColor
paint_fill_color() const { return SK_ColorBLACK
| fill_color_
; }
49 gfx::Rect track_rect_
;
52 DISALLOW_COPY_AND_ASSIGN(FakeScrollbar
);
57 #endif // CC_TEST_FAKE_SCROLLBAR_H_