| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 blink::WebCanvas* canvas = gc->canvas(); | 136 blink::WebCanvas* canvas = gc->canvas(); |
| 137 if (scrollbar->pressedPart() == ThumbPart) | 137 if (scrollbar->pressedPart() == ThumbPart) |
| 138 state = blink::WebThemeEngine::StatePressed; | 138 state = blink::WebThemeEngine::StatePressed; |
| 139 else if (scrollbar->hoveredPart() == ThumbPart) | 139 else if (scrollbar->hoveredPart() == ThumbPart) |
| 140 state = blink::WebThemeEngine::StateHover; | 140 state = blink::WebThemeEngine::StateHover; |
| 141 else | 141 else |
| 142 state = blink::WebThemeEngine::StateNormal; | 142 state = blink::WebThemeEngine::StateNormal; |
| 143 blink::Platform::current()->themeEngine()->paint(canvas, scrollbar->orientat
ion() == HorizontalScrollbar ? blink::WebThemeEngine::PartScrollbarHorizontalThu
mb : blink::WebThemeEngine::PartScrollbarVerticalThumb, state, blink::WebRect(re
ct), 0); | 143 blink::Platform::current()->themeEngine()->paint(canvas, scrollbar->orientat
ion() == HorizontalScrollbar ? blink::WebThemeEngine::PartScrollbarHorizontalThu
mb : blink::WebThemeEngine::PartScrollbarVerticalThumb, state, blink::WebRect(re
ct), 0); |
| 144 } | 144 } |
| 145 | 145 |
| 146 bool ScrollbarThemeGtkOrAura::shouldCenterOnThumb(ScrollbarThemeClient*, const P
latformMouseEvent& evt) | |
| 147 { | |
| 148 return (evt.shiftKey() && evt.button() == LeftButton) || (evt.button() == Mi
ddleButton); | |
| 149 } | |
| 150 | |
| 151 IntSize ScrollbarThemeGtkOrAura::buttonSize(ScrollbarThemeClient* scrollbar) | 146 IntSize ScrollbarThemeGtkOrAura::buttonSize(ScrollbarThemeClient* scrollbar) |
| 152 { | 147 { |
| 153 if (scrollbar->orientation() == VerticalScrollbar) { | 148 if (scrollbar->orientation() == VerticalScrollbar) { |
| 154 IntSize size = blink::Platform::current()->themeEngine()->getSize(blink:
:WebThemeEngine::PartScrollbarUpArrow); | 149 IntSize size = blink::Platform::current()->themeEngine()->getSize(blink:
:WebThemeEngine::PartScrollbarUpArrow); |
| 155 return IntSize(size.width(), scrollbar->height() < 2 * size.height() ? s
crollbar->height() / 2 : size.height()); | 150 return IntSize(size.width(), scrollbar->height() < 2 * size.height() ? s
crollbar->height() / 2 : size.height()); |
| 156 } | 151 } |
| 157 | 152 |
| 158 // HorizontalScrollbar | 153 // HorizontalScrollbar |
| 159 IntSize size = blink::Platform::current()->themeEngine()->getSize(blink::Web
ThemeEngine::PartScrollbarLeftArrow); | 154 IntSize size = blink::Platform::current()->themeEngine()->getSize(blink::Web
ThemeEngine::PartScrollbarLeftArrow); |
| 160 return IntSize(scrollbar->width() < 2 * size.width() ? scrollbar->width() /
2 : size.width(), size.height()); | 155 return IntSize(scrollbar->width() < 2 * size.width() ? scrollbar->width() /
2 : size.width(), size.height()); |
| 161 } | 156 } |
| 162 | 157 |
| 163 int ScrollbarThemeGtkOrAura::minimumThumbLength(ScrollbarThemeClient* scrollbar) | 158 int ScrollbarThemeGtkOrAura::minimumThumbLength(ScrollbarThemeClient* scrollbar) |
| 164 { | 159 { |
| 165 if (scrollbar->orientation() == VerticalScrollbar) { | 160 if (scrollbar->orientation() == VerticalScrollbar) { |
| 166 IntSize size = blink::Platform::current()->themeEngine()->getSize(blink:
:WebThemeEngine::PartScrollbarVerticalThumb); | 161 IntSize size = blink::Platform::current()->themeEngine()->getSize(blink:
:WebThemeEngine::PartScrollbarVerticalThumb); |
| 167 return size.height(); | 162 return size.height(); |
| 168 } | 163 } |
| 169 | 164 |
| 170 IntSize size = blink::Platform::current()->themeEngine()->getSize(blink::Web
ThemeEngine::PartScrollbarHorizontalThumb); | 165 IntSize size = blink::Platform::current()->themeEngine()->getSize(blink::Web
ThemeEngine::PartScrollbarHorizontalThumb); |
| 171 return size.width(); | 166 return size.width(); |
| 172 } | 167 } |
| 173 | 168 |
| 174 } // namespace WebCore | 169 } // namespace WebCore |
| OLD | NEW |