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
3 // found in the LICENSE file.
5 #include "cc/test/fake_scrollbar.h"
7 #include "third_party/skia/include/core/SkCanvas.h"
11 FakeScrollbar::FakeScrollbar()
17 track_rect_(0, 0, 100, 10),
18 fill_color_(SK_ColorGREEN
) {}
20 FakeScrollbar::FakeScrollbar(bool paint
, bool has_thumb
, bool is_overlay
)
22 has_thumb_(has_thumb
),
23 is_overlay_(is_overlay
),
26 track_rect_(0, 0, 100, 10),
27 fill_color_(SK_ColorGREEN
) {}
29 FakeScrollbar::~FakeScrollbar() {}
31 ScrollbarOrientation
FakeScrollbar::Orientation() const {
35 gfx::Point
FakeScrollbar::Location() const { return location_
; }
37 bool FakeScrollbar::IsOverlay() const { return is_overlay_
; }
39 bool FakeScrollbar::HasThumb() const { return has_thumb_
; }
41 int FakeScrollbar::ThumbThickness() const {
42 return thumb_thickness_
;
45 int FakeScrollbar::ThumbLength() const {
49 gfx::Rect
FakeScrollbar::TrackRect() const {
53 void FakeScrollbar::PaintPart(SkCanvas
* canvas
,
55 gfx::Rect content_rect
) {
59 // Fill the scrollbar with a different color each time.
61 canvas
->clear(SK_ColorBLACK
| fill_color_
);