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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
229 if (Platform::current()->themeEngine()) { | 229 if (Platform::current()->themeEngine()) { |
230 Platform::current()->themeEngine()->getOverlayScrollbarStyle(&style); | 230 Platform::current()->themeEngine()->getOverlayScrollbarStyle(&style); |
231 } | 231 } |
232 theme = new ScrollbarThemeOverlay( | 232 theme = new ScrollbarThemeOverlay( |
233 style.thumbThickness, style.scrollbarMargin, | 233 style.thumbThickness, style.scrollbarMargin, |
234 ScrollbarThemeOverlay::DisallowHitTest, Color(style.color)); | 234 ScrollbarThemeOverlay::DisallowHitTest, Color(style.color)); |
235 } | 235 } |
236 return *theme; | 236 return *theme; |
237 } | 237 } |
238 | 238 |
239 bool ScrollbarThemeOverlay::usesNinePatchThumbResource() const { | |
240 WebThemeEngine* engine = Platform::current()->themeEngine(); | |
241 if (!engine) | |
242 return false; | |
243 | |
244 // Thumb orientation doesn't matter here. | |
245 return engine->supportsNinePatch(WebThemeEngine::PartScrollbarVerticalThumb); | |
246 } | |
247 | |
248 IntSize ScrollbarThemeOverlay::ninePatchThumbCanvasSize( | |
249 const ScrollbarThemeClient& scrollbar) const { | |
250 DCHECK(usesNinePatchThumbResource()); | |
251 | |
252 WebThemeEngine::Part part = WebThemeEngine::PartScrollbarHorizontalThumb; | |
jbroman
2017/03/01 15:27:18
super-nit: for something this simple why not a ter
bokan
2017/03/01 16:22:45
Done.
| |
253 if (scrollbar.orientation() == VerticalScrollbar) | |
254 part = WebThemeEngine::PartScrollbarVerticalThumb; | |
255 | |
256 DCHECK(Platform::current()->themeEngine()); | |
257 return Platform::current()->themeEngine()->ninePatchCanvasSize(part); | |
258 } | |
259 | |
260 IntRect ScrollbarThemeOverlay::ninePatchThumbAperture( | |
261 const ScrollbarThemeClient& scrollbar) const { | |
262 DCHECK(usesNinePatchThumbResource()); | |
263 | |
264 WebThemeEngine::Part part = WebThemeEngine::PartScrollbarHorizontalThumb; | |
265 if (scrollbar.orientation() == VerticalScrollbar) | |
266 part = WebThemeEngine::PartScrollbarVerticalThumb; | |
267 | |
268 DCHECK(Platform::current()->themeEngine()); | |
269 return Platform::current()->themeEngine()->ninePatchAperture(part); | |
270 } | |
271 | |
239 } // namespace blink | 272 } // namespace blink |
OLD | NEW |