blob: 21fb8f32148102f8981e292eb75f36528edfa49b [file] [log] [blame]
[email protected]467b3612012-08-28 07:41:161// 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.
4
5#include "config.h"
6
[email protected]c4040a522012-10-21 15:01:407#include "cc/scrollbar_geometry_stub.h"
[email protected]467b3612012-08-28 07:41:168
9using WebKit::WebRect;
10using WebKit::WebScrollbar;
11using WebKit::WebScrollbarThemeGeometry;
12
[email protected]9c88e562012-09-14 22:21:3013namespace cc {
[email protected]467b3612012-08-28 07:41:1614
[email protected]96baf3e2012-10-22 23:09:5515ScrollbarGeometryStub::ScrollbarGeometryStub(scoped_ptr<WebScrollbarThemeGeometry> geometry)
[email protected]31161582012-10-16 21:08:0316 : m_geometry(geometry.Pass())
[email protected]467b3612012-08-28 07:41:1617{
18}
19
[email protected]96baf3e2012-10-22 23:09:5520ScrollbarGeometryStub::~ScrollbarGeometryStub()
[email protected]467b3612012-08-28 07:41:1621{
22}
23
[email protected]96baf3e2012-10-22 23:09:5524WebScrollbarThemeGeometry* ScrollbarGeometryStub::clone() const
[email protected]467b3612012-08-28 07:41:1625{
26 return m_geometry->clone();
27}
28
[email protected]96baf3e2012-10-22 23:09:5529int ScrollbarGeometryStub::thumbPosition(WebScrollbar* scrollbar)
[email protected]467b3612012-08-28 07:41:1630{
31 return m_geometry->thumbPosition(scrollbar);
32}
33
[email protected]96baf3e2012-10-22 23:09:5534int ScrollbarGeometryStub::thumbLength(WebScrollbar* scrollbar)
[email protected]467b3612012-08-28 07:41:1635{
36 return m_geometry->thumbLength(scrollbar);
37}
38
[email protected]96baf3e2012-10-22 23:09:5539int ScrollbarGeometryStub::trackPosition(WebScrollbar* scrollbar)
[email protected]467b3612012-08-28 07:41:1640{
41 return m_geometry->trackPosition(scrollbar);
42}
43
[email protected]96baf3e2012-10-22 23:09:5544int ScrollbarGeometryStub::trackLength(WebScrollbar* scrollbar)
[email protected]467b3612012-08-28 07:41:1645{
46 return m_geometry->trackLength(scrollbar);
47}
48
[email protected]96baf3e2012-10-22 23:09:5549bool ScrollbarGeometryStub::hasButtons(WebScrollbar* scrollbar)
[email protected]467b3612012-08-28 07:41:1650{
51 return m_geometry->hasButtons(scrollbar);
52}
53
[email protected]96baf3e2012-10-22 23:09:5554bool ScrollbarGeometryStub::hasThumb(WebScrollbar* scrollbar)
[email protected]467b3612012-08-28 07:41:1655{
56 return m_geometry->hasThumb(scrollbar);
57}
58
[email protected]96baf3e2012-10-22 23:09:5559WebRect ScrollbarGeometryStub::trackRect(WebScrollbar* scrollbar)
[email protected]467b3612012-08-28 07:41:1660{
61 return m_geometry->trackRect(scrollbar);
62}
63
[email protected]96baf3e2012-10-22 23:09:5564WebRect ScrollbarGeometryStub::thumbRect(WebScrollbar* scrollbar)
[email protected]467b3612012-08-28 07:41:1665{
66 return m_geometry->thumbRect(scrollbar);
67}
68
[email protected]96baf3e2012-10-22 23:09:5569int ScrollbarGeometryStub::minimumThumbLength(WebScrollbar* scrollbar)
[email protected]467b3612012-08-28 07:41:1670{
71 return m_geometry->minimumThumbLength(scrollbar);
72}
73
[email protected]96baf3e2012-10-22 23:09:5574int ScrollbarGeometryStub::scrollbarThickness(WebScrollbar* scrollbar)
[email protected]467b3612012-08-28 07:41:1675{
76 return m_geometry->scrollbarThickness(scrollbar);
77}
78
[email protected]96baf3e2012-10-22 23:09:5579WebRect ScrollbarGeometryStub::backButtonStartRect(WebScrollbar* scrollbar)
[email protected]467b3612012-08-28 07:41:1680{
81 return m_geometry->backButtonStartRect(scrollbar);
82}
83
[email protected]96baf3e2012-10-22 23:09:5584WebRect ScrollbarGeometryStub::backButtonEndRect(WebScrollbar* scrollbar)
[email protected]467b3612012-08-28 07:41:1685{
86 return m_geometry->backButtonEndRect(scrollbar);
87}
88
[email protected]96baf3e2012-10-22 23:09:5589WebRect ScrollbarGeometryStub::forwardButtonStartRect(WebScrollbar* scrollbar)
[email protected]467b3612012-08-28 07:41:1690{
91 return m_geometry->forwardButtonStartRect(scrollbar);
92}
93
[email protected]96baf3e2012-10-22 23:09:5594WebRect ScrollbarGeometryStub::forwardButtonEndRect(WebScrollbar* scrollbar)
[email protected]467b3612012-08-28 07:41:1695{
96 return m_geometry->forwardButtonEndRect(scrollbar);
97}
98
[email protected]96baf3e2012-10-22 23:09:5599WebRect ScrollbarGeometryStub::constrainTrackRectToTrackPieces(WebScrollbar* scrollbar, const WebRect& rect)
[email protected]467b3612012-08-28 07:41:16100{
101 return m_geometry->constrainTrackRectToTrackPieces(scrollbar, rect);
102}
103
[email protected]96baf3e2012-10-22 23:09:55104void ScrollbarGeometryStub::splitTrack(WebScrollbar* scrollbar, const WebRect& unconstrainedTrackRect, WebRect& beforeThumbRect, WebRect& thumbRect, WebRect& afterThumbRect)
[email protected]467b3612012-08-28 07:41:16105{
106 m_geometry->splitTrack(scrollbar, unconstrainedTrackRect, beforeThumbRect, thumbRect, afterThumbRect);
107}
108
[email protected]bc5e77c2012-11-05 20:00:49109} // namespace cc