| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved. | 2 * Copyright (c) 2008, 2009, 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 return &theme; | 55 return &theme; |
| 56 } | 56 } |
| 57 | 57 |
| 58 DEFINE_STATIC_LOCAL(ScrollbarThemeGtkOrAura, theme, ()); | 58 DEFINE_STATIC_LOCAL(ScrollbarThemeGtkOrAura, theme, ()); |
| 59 return &theme; | 59 return &theme; |
| 60 } | 60 } |
| 61 | 61 |
| 62 int ScrollbarThemeGtkOrAura::scrollbarThickness(ScrollbarControlSize controlSize
) | 62 int ScrollbarThemeGtkOrAura::scrollbarThickness(ScrollbarControlSize controlSize
) |
| 63 { | 63 { |
| 64 // Horiz and Vert scrollbars are the same thickness. | 64 // Horiz and Vert scrollbars are the same thickness. |
| 65 // In unit tests we don't have the mock theme engine (because of layering vi
olations), so we hard code the size (see bug 327470). |
| 66 if (useMockTheme()) |
| 67 return 15; |
| 65 IntSize scrollbarSize = blink::Platform::current()->themeEngine()->getSize(b
link::WebThemeEngine::PartScrollbarVerticalTrack); | 68 IntSize scrollbarSize = blink::Platform::current()->themeEngine()->getSize(b
link::WebThemeEngine::PartScrollbarVerticalTrack); |
| 66 return scrollbarSize.width(); | 69 return scrollbarSize.width(); |
| 67 } | 70 } |
| 68 | 71 |
| 69 void ScrollbarThemeGtkOrAura::paintTrackPiece(GraphicsContext* gc, ScrollbarThem
eClient* scrollbar, const IntRect& rect, ScrollbarPart partType) | 72 void ScrollbarThemeGtkOrAura::paintTrackPiece(GraphicsContext* gc, ScrollbarThem
eClient* scrollbar, const IntRect& rect, ScrollbarPart partType) |
| 70 { | 73 { |
| 71 blink::WebThemeEngine::State state = scrollbar->hoveredPart() == partType ?
blink::WebThemeEngine::StateHover : blink::WebThemeEngine::StateNormal; | 74 blink::WebThemeEngine::State state = scrollbar->hoveredPart() == partType ?
blink::WebThemeEngine::StateHover : blink::WebThemeEngine::StateNormal; |
| 72 | 75 |
| 73 if (useMockTheme() && !scrollbar->enabled()) | 76 if (useMockTheme() && !scrollbar->enabled()) |
| 74 state = blink::WebThemeEngine::StateDisabled; | 77 state = blink::WebThemeEngine::StateDisabled; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 if (scrollbar->orientation() == VerticalScrollbar) { | 165 if (scrollbar->orientation() == VerticalScrollbar) { |
| 163 IntSize size = blink::Platform::current()->themeEngine()->getSize(blink:
:WebThemeEngine::PartScrollbarVerticalThumb); | 166 IntSize size = blink::Platform::current()->themeEngine()->getSize(blink:
:WebThemeEngine::PartScrollbarVerticalThumb); |
| 164 return size.height(); | 167 return size.height(); |
| 165 } | 168 } |
| 166 | 169 |
| 167 IntSize size = blink::Platform::current()->themeEngine()->getSize(blink::Web
ThemeEngine::PartScrollbarHorizontalThumb); | 170 IntSize size = blink::Platform::current()->themeEngine()->getSize(blink::Web
ThemeEngine::PartScrollbarHorizontalThumb); |
| 168 return size.width(); | 171 return size.width(); |
| 169 } | 172 } |
| 170 | 173 |
| 171 } // namespace WebCore | 174 } // namespace WebCore |
| OLD | NEW |