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