Fix build break
[chromium-blink-merge.git] / cc / test / fake_web_scrollbar_theme_geometry.cc
blob15163face8ba025f7c9cf45c984dc7ac77de57c1
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 #include "cc/test/fake_web_scrollbar_theme_geometry.h"
7 using WebKit::WebRect;
9 namespace cc {
11 WebKit::WebScrollbarThemeGeometry*
12 FakeWebScrollbarThemeGeometry::clone() const {
13 return new FakeWebScrollbarThemeGeometry(has_thumb_);
16 int FakeWebScrollbarThemeGeometry::thumbPosition(
17 WebKit::WebScrollbar* scrollbar) {
18 if (!has_thumb_)
19 return 0;
20 return 5;
23 int FakeWebScrollbarThemeGeometry::thumbLength(
24 WebKit::WebScrollbar* scrollbar) {
25 if (!has_thumb_)
26 return 0;
27 return 2;
30 int FakeWebScrollbarThemeGeometry::trackPosition(
31 WebKit::WebScrollbar* scrollbar) {
32 return 0;
35 int FakeWebScrollbarThemeGeometry::trackLength(
36 WebKit::WebScrollbar* scrollbar) {
37 return 10;
40 bool FakeWebScrollbarThemeGeometry::hasButtons(
41 WebKit::WebScrollbar* scrollbar) {
42 return false;
45 bool FakeWebScrollbarThemeGeometry::hasThumb(WebKit::WebScrollbar* scrollbar) {
46 return has_thumb_;
49 WebRect FakeWebScrollbarThemeGeometry::trackRect(
50 WebKit::WebScrollbar* scrollbar) {
51 return WebRect(0, 0, 10, 10);
54 WebRect FakeWebScrollbarThemeGeometry::thumbRect(
55 WebKit::WebScrollbar* scrollbar) {
56 if (!has_thumb_)
57 return WebRect(0, 0, 0, 0);
58 return WebRect(0, 5, 5, 2);
61 int FakeWebScrollbarThemeGeometry::minimumThumbLength(
62 WebKit::WebScrollbar* scrollbar) {
63 return 0;
66 int FakeWebScrollbarThemeGeometry::scrollbarThickness(
67 WebKit::WebScrollbar* scrollbar) {
68 return 0;
71 WebRect FakeWebScrollbarThemeGeometry::backButtonStartRect(
72 WebKit::WebScrollbar* scrollbar) {
73 return WebRect();
76 WebRect FakeWebScrollbarThemeGeometry::backButtonEndRect(
77 WebKit::WebScrollbar* scrollbar) {
78 return WebRect();
81 WebRect FakeWebScrollbarThemeGeometry::forwardButtonStartRect(
82 WebKit::WebScrollbar* scrollbar) {
83 return WebRect();
86 WebRect FakeWebScrollbarThemeGeometry::forwardButtonEndRect(
87 WebKit::WebScrollbar* scrollbar) {
88 return WebRect();
91 WebRect FakeWebScrollbarThemeGeometry::constrainTrackRectToTrackPieces(
92 WebKit::WebScrollbar* scrollbar,
93 const WebRect& rect) {
94 return WebRect();
97 void FakeWebScrollbarThemeGeometry::splitTrack(WebKit::WebScrollbar* scrollbar,
98 const WebRect& track,
99 WebRect& start_track,
100 WebRect& thumb,
101 WebRect& end_track) {
102 if (!has_thumb_) {
103 thumb = WebRect(0, 0, 0, 0);
104 start_track = WebRect(0, 0, 10, 10);
105 end_track = WebRect(0, 10, 10, 0);
106 } else {
107 thumb = WebRect(0, 5, 5, 2);
108 start_track = WebRect(0, 5, 0, 5);
109 end_track = WebRect(0, 0, 0, 5);
113 } // namespace cc