add a use_alsa gyp setting
[chromium-blink-merge.git] / cc / test / fake_web_scrollbar_theme_geometry.cc
blob8a0f378875bf5998931a6500967d3c078f24436d
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(m_hasThumb);
16 int FakeWebScrollbarThemeGeometry::thumbPosition(WebKit::WebScrollbar*) {
17 if (!m_hasThumb)
18 return 0;
19 return 5;
22 int FakeWebScrollbarThemeGeometry::thumbLength(WebKit::WebScrollbar*) {
23 if (!m_hasThumb)
24 return 0;
25 return 2;
28 int FakeWebScrollbarThemeGeometry::trackPosition(WebKit::WebScrollbar*) {
29 return 0;
32 int FakeWebScrollbarThemeGeometry::trackLength(WebKit::WebScrollbar*) {
33 return 10;
36 bool FakeWebScrollbarThemeGeometry::hasButtons(WebKit::WebScrollbar*) {
37 return false;
40 bool FakeWebScrollbarThemeGeometry::hasThumb(WebKit::WebScrollbar*) {
41 return m_hasThumb;
44 WebRect FakeWebScrollbarThemeGeometry::trackRect(WebKit::WebScrollbar*) {
45 return WebRect(0, 0, 10, 10);
48 WebRect FakeWebScrollbarThemeGeometry::thumbRect(WebKit::WebScrollbar*) {
49 if (!m_hasThumb)
50 return WebRect(0, 0, 0, 0);
51 return WebRect(0, 5, 5, 2);
54 int FakeWebScrollbarThemeGeometry::minimumThumbLength(WebKit::WebScrollbar*) {
55 return 0;
58 int FakeWebScrollbarThemeGeometry::scrollbarThickness(WebKit::WebScrollbar*) {
59 return 0;
62 WebRect FakeWebScrollbarThemeGeometry::backButtonStartRect(
63 WebKit::WebScrollbar*) {
64 return WebRect();
67 WebRect FakeWebScrollbarThemeGeometry::backButtonEndRect(
68 WebKit::WebScrollbar*) {
69 return WebRect();
72 WebRect FakeWebScrollbarThemeGeometry::forwardButtonStartRect(
73 WebKit::WebScrollbar*) {
74 return WebRect();
77 WebRect FakeWebScrollbarThemeGeometry::forwardButtonEndRect(
78 WebKit::WebScrollbar*) {
79 return WebRect();
82 WebRect FakeWebScrollbarThemeGeometry::constrainTrackRectToTrackPieces(
83 WebKit::WebScrollbar*,
84 const WebRect&) {
85 return WebRect();
88 void FakeWebScrollbarThemeGeometry::splitTrack(
89 WebKit::WebScrollbar*,
90 const WebRect& track,
91 WebRect& startTrack,
92 WebRect& thumb,
93 WebRect& endTrack) {
94 if (!m_hasThumb) {
95 thumb = WebRect(0, 0, 0, 0);
96 startTrack = WebRect(0, 0, 10, 10);
97 endTrack = WebRect(0, 10, 10, 0);
98 } else {
99 thumb = WebRect(0, 5, 5, 2);
100 startTrack = WebRect(0, 5, 0, 5);
101 endTrack = WebRect(0, 0, 0, 5);
105 } // namespace cc