OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 state = WebThemeEngine::StatePressed; | 155 state = WebThemeEngine::StatePressed; |
156 else if (scrollbar.hoveredPart() == ThumbPart) | 156 else if (scrollbar.hoveredPart() == ThumbPart) |
157 state = WebThemeEngine::StateHover; | 157 state = WebThemeEngine::StateHover; |
158 | 158 |
159 WebCanvas* canvas = context.canvas(); | 159 WebCanvas* canvas = context.canvas(); |
160 | 160 |
161 WebThemeEngine::Part part = WebThemeEngine::PartScrollbarHorizontalThumb; | 161 WebThemeEngine::Part part = WebThemeEngine::PartScrollbarHorizontalThumb; |
162 if (scrollbar.orientation() == VerticalScrollbar) | 162 if (scrollbar.orientation() == VerticalScrollbar) |
163 part = WebThemeEngine::PartScrollbarVerticalThumb; | 163 part = WebThemeEngine::PartScrollbarVerticalThumb; |
164 | 164 |
| 165 blink::WebThemeEngine::ExtraParams params; |
| 166 params.scrollbarThumb.scrollbarTheme = |
| 167 static_cast<WebScrollbarOverlayColorTheme>( |
| 168 scrollbar.getScrollbarOverlayColorTheme()); |
| 169 |
165 Platform::current()->themeEngine()->paint(canvas, part, state, WebRect(rect), | 170 Platform::current()->themeEngine()->paint(canvas, part, state, WebRect(rect), |
166 0); | 171 ¶ms); |
167 } | 172 } |
168 | 173 |
169 ScrollbarPart ScrollbarThemeOverlay::hitTest( | 174 ScrollbarPart ScrollbarThemeOverlay::hitTest( |
170 const ScrollbarThemeClient& scrollbar, | 175 const ScrollbarThemeClient& scrollbar, |
171 const IntPoint& position) { | 176 const IntPoint& position) { |
172 if (m_allowHitTest == DisallowHitTest) | 177 if (m_allowHitTest == DisallowHitTest) |
173 return NoPart; | 178 return NoPart; |
174 | 179 |
175 return ScrollbarTheme::hitTest(scrollbar, position); | 180 return ScrollbarTheme::hitTest(scrollbar, position); |
176 } | 181 } |
177 | 182 |
178 ScrollbarThemeOverlay& ScrollbarThemeOverlay::mobileTheme() { | 183 ScrollbarThemeOverlay& ScrollbarThemeOverlay::mobileTheme() { |
179 static ScrollbarThemeOverlay* theme; | 184 static ScrollbarThemeOverlay* theme; |
180 if (!theme) { | 185 if (!theme) { |
181 WebThemeEngine::ScrollbarStyle style = {3, 3, 0x80808080}; // default style | 186 WebThemeEngine::ScrollbarStyle style = {3, 3, 0x80808080}; // default style |
182 if (Platform::current()->themeEngine()) { | 187 if (Platform::current()->themeEngine()) { |
183 Platform::current()->themeEngine()->getOverlayScrollbarStyle(&style); | 188 Platform::current()->themeEngine()->getOverlayScrollbarStyle(&style); |
184 } | 189 } |
185 theme = new ScrollbarThemeOverlay( | 190 theme = new ScrollbarThemeOverlay( |
186 style.thumbThickness, style.scrollbarMargin, | 191 style.thumbThickness, style.scrollbarMargin, |
187 ScrollbarThemeOverlay::DisallowHitTest, Color(style.color)); | 192 ScrollbarThemeOverlay::DisallowHitTest, Color(style.color)); |
188 } | 193 } |
189 return *theme; | 194 return *theme; |
190 } | 195 } |
191 | 196 |
192 } // namespace blink | 197 } // namespace blink |
OLD | NEW |