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 has_thumb
) {
16 return scoped_ptr
<WebKit::WebScrollbarThemeGeometry
>(
17 new FakeWebScrollbarThemeGeometry(has_thumb
));
20 // WebScrollbarThemeGeometry implementation.
21 virtual WebKit::WebScrollbarThemeGeometry
* clone() const OVERRIDE
;
22 virtual int thumbPosition(WebKit::WebScrollbar
* scrollbar
) OVERRIDE
;
23 virtual int thumbLength(WebKit::WebScrollbar
* scrollbar
) OVERRIDE
;
24 virtual int trackPosition(WebKit::WebScrollbar
* scrollbar
) OVERRIDE
;
25 virtual int trackLength(WebKit::WebScrollbar
* scrollbar
) OVERRIDE
;
26 virtual bool hasButtons(WebKit::WebScrollbar
* scrollbar
) OVERRIDE
;
27 virtual bool hasThumb(WebKit::WebScrollbar
* scrollbar
) OVERRIDE
;
28 virtual WebKit::WebRect
trackRect(WebKit::WebScrollbar
* scrollbar
) OVERRIDE
;
29 virtual WebKit::WebRect
thumbRect(WebKit::WebScrollbar
* scrollbar
) OVERRIDE
;
30 virtual int minimumThumbLength(WebKit::WebScrollbar
* scrollbar
) OVERRIDE
;
31 virtual int scrollbarThickness(WebKit::WebScrollbar
* scrollbar
) OVERRIDE
;
32 virtual WebKit::WebRect
backButtonStartRect(WebKit::WebScrollbar
* scrollbar
)
34 virtual WebKit::WebRect
backButtonEndRect(WebKit::WebScrollbar
* scrollbar
)
36 virtual WebKit::WebRect
forwardButtonStartRect(
37 WebKit::WebScrollbar
* scrollbar
) OVERRIDE
;
38 virtual WebKit::WebRect
forwardButtonEndRect(WebKit::WebScrollbar
* scrollbar
)
40 virtual WebKit::WebRect
constrainTrackRectToTrackPieces(
41 WebKit::WebScrollbar
* scrollbar
,
42 const WebKit::WebRect
& rect
) OVERRIDE
;
43 virtual void splitTrack(WebKit::WebScrollbar
* scrollbar
,
44 const WebKit::WebRect
& track
,
45 WebKit::WebRect
& start_track
,
46 WebKit::WebRect
& thumb
,
47 WebKit::WebRect
& end_track
) OVERRIDE
;
50 explicit FakeWebScrollbarThemeGeometry(bool has_thumb
)
51 : has_thumb_(has_thumb
) {}
57 #endif // CC_TEST_FAKE_WEB_SCROLLBAR_THEME_GEOMETRY_H_