Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: sky/engine/platform/exported/WebScrollbarThemeGeometryNative.cpp

Issue 720713003: Remove WebScroll* (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26 #include "config.h"
27
28 #include "platform/exported/WebScrollbarThemeGeometryNative.h"
29
30 #include "platform/scroll/Scrollbar.h"
31 #include "public/platform/WebScrollbar.h"
32
33 namespace blink {
34
35 PassOwnPtr<WebScrollbarThemeGeometryNative> WebScrollbarThemeGeometryNative::cre ate(Scrollbar* scrollbar)
36 {
37 return adoptPtr(new WebScrollbarThemeGeometryNative(scrollbar));
38 }
39
40 WebScrollbarThemeGeometryNative::WebScrollbarThemeGeometryNative(Scrollbar* scro llbar)
41 : m_scrollbar(scrollbar)
42 {
43 }
44
45 WebScrollbarThemeGeometryNative* WebScrollbarThemeGeometryNative::clone() const
46 {
47 return new WebScrollbarThemeGeometryNative(m_scrollbar);
48 }
49
50 int WebScrollbarThemeGeometryNative::thumbPosition()
51 {
52 return m_scrollbar->thumbPosition();
53 }
54
55 int WebScrollbarThemeGeometryNative::thumbLength()
56 {
57 return m_scrollbar->thumbLength();
58 }
59
60 int WebScrollbarThemeGeometryNative::trackPosition()
61 {
62 return m_scrollbar->trackPosition();
63 }
64
65 int WebScrollbarThemeGeometryNative::trackLength()
66 {
67 return m_scrollbar->trackLength();
68 }
69
70 WebRect WebScrollbarThemeGeometryNative::trackRect()
71 {
72 return m_scrollbar->trackRect();
73 }
74
75 WebRect WebScrollbarThemeGeometryNative::thumbRect()
76 {
77 return m_scrollbar->thumbRect();
78 }
79
80 int WebScrollbarThemeGeometryNative::minimumThumbLength()
81 {
82 return m_scrollbar->minimumThumbLength();
83 }
84
85 int WebScrollbarThemeGeometryNative::scrollbarThickness()
86 {
87 return m_scrollbar->scrollbarThickness();
88 }
89
90 void WebScrollbarThemeGeometryNative::splitTrack(const WebRect& webTrack, WebRec t& webStartTrack, WebRect& webThumb, WebRect& webEndTrack)
91 {
92 IntRect track(webTrack);
93 IntRect startTrack;
94 IntRect thumb;
95 IntRect endTrack;
96 m_scrollbar->splitTrack(track, startTrack, thumb, endTrack);
97
98 webStartTrack = startTrack;
99 webThumb = thumb;
100 webEndTrack = endTrack;
101 }
102
103 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698