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 bool FakeScrollbar::IsLeftSideVerticalScrollbar() const {
39 gfx::Point FakeScrollbar::Location() const { return location_; }
41 bool FakeScrollbar::IsOverlay() const { return is_overlay_; }
43 bool FakeScrollbar::HasThumb() const { return has_thumb_; }
45 int FakeScrollbar::ThumbThickness() const {
46 return thumb_thickness_;
49 int FakeScrollbar::ThumbLength() const {
53 gfx::Rect FakeScrollbar::TrackRect() const {
57 void FakeScrollbar::PaintPart(SkCanvas* canvas,
59 gfx::Rect content_rect) {
63 // Fill the scrollbar with a different color each time.
65 canvas->clear(SK_ColorBLACK | fill_color_);