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_WEB_SCROLLBAR_THEME_GEOMETRY_H_
6 #define CC_TEST_FAKE_WEB_SCROLLBAR_THEME_GEOMETRY_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "third_party/WebKit/Source/Platform/chromium/public/WebScrollbarThemeGeometry.h"
13 class FakeWebScrollbarThemeGeometry
: public WebKit::WebScrollbarThemeGeometry
{
15 static scoped_ptr
<WebKit::WebScrollbarThemeGeometry
> create(bool hasThumb
) { return scoped_ptr
<WebKit::WebScrollbarThemeGeometry
>(new FakeWebScrollbarThemeGeometry(hasThumb
)); }
17 virtual WebKit::WebScrollbarThemeGeometry
* clone() const OVERRIDE
;
19 virtual int thumbPosition(WebKit::WebScrollbar
*) OVERRIDE
;
20 virtual int thumbLength(WebKit::WebScrollbar
*) OVERRIDE
;
21 virtual int trackPosition(WebKit::WebScrollbar
*) OVERRIDE
;
22 virtual int trackLength(WebKit::WebScrollbar
*) OVERRIDE
;
23 virtual bool hasButtons(WebKit::WebScrollbar
*) OVERRIDE
;
24 virtual bool hasThumb(WebKit::WebScrollbar
*) OVERRIDE
;
25 virtual WebKit::WebRect
trackRect(WebKit::WebScrollbar
*) OVERRIDE
;
26 virtual WebKit::WebRect
thumbRect(WebKit::WebScrollbar
*) OVERRIDE
;
27 virtual int minimumThumbLength(WebKit::WebScrollbar
*) OVERRIDE
;
28 virtual int scrollbarThickness(WebKit::WebScrollbar
*) OVERRIDE
;
29 virtual WebKit::WebRect
backButtonStartRect(WebKit::WebScrollbar
*) OVERRIDE
;
30 virtual WebKit::WebRect
backButtonEndRect(WebKit::WebScrollbar
*) OVERRIDE
;
31 virtual WebKit::WebRect
forwardButtonStartRect(WebKit::WebScrollbar
*) OVERRIDE
;
32 virtual WebKit::WebRect
forwardButtonEndRect(WebKit::WebScrollbar
*) OVERRIDE
;
33 virtual WebKit::WebRect
constrainTrackRectToTrackPieces(WebKit::WebScrollbar
*, const WebKit::WebRect
&) OVERRIDE
;
34 virtual void splitTrack(WebKit::WebScrollbar
*, const WebKit::WebRect
& track
, WebKit::WebRect
& startTrack
, WebKit::WebRect
& thumb
, WebKit::WebRect
& endTrack
) OVERRIDE
;
37 FakeWebScrollbarThemeGeometry(bool hasThumb
) : m_hasThumb(hasThumb
) { }
43 #endif // CC_TEST_FAKE_WEB_SCROLLBAR_THEME_GEOMETRY_H_