OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 [painter setKnobStyle:NSScrollerKnobStyleDark]; | 210 [painter setKnobStyle:NSScrollerKnobStyleDark]; |
211 break; | 211 break; |
212 case ScrollbarOverlayStyleLight: | 212 case ScrollbarOverlayStyleLight: |
213 [painter setKnobStyle:NSScrollerKnobStyleLight]; | 213 [painter setKnobStyle:NSScrollerKnobStyleLight]; |
214 break; | 214 break; |
215 } | 215 } |
216 } | 216 } |
217 | 217 |
218 ScrollbarButtonsPlacement ScrollbarThemeMacOverlayAPI::buttonsPlacement() const | 218 ScrollbarButtonsPlacement ScrollbarThemeMacOverlayAPI::buttonsPlacement() const |
219 { | 219 { |
220 return ScrollbarButtonsNone; | 220 return ScrollbarButtonsPlacementNone; |
221 } | 221 } |
222 | 222 |
223 bool ScrollbarThemeMacOverlayAPI::hasThumb(ScrollbarThemeClient* scrollbar) | 223 bool ScrollbarThemeMacOverlayAPI::hasThumb(ScrollbarThemeClient* scrollbar) |
224 { | 224 { |
225 ScrollbarPainter painter = painterForScrollbar(scrollbar); | 225 ScrollbarPainter painter = painterForScrollbar(scrollbar); |
226 int minLengthForThumb = [painter knobMinLength] + [painter trackOverlapEndIn
set] + [painter knobOverlapEndInset] | 226 int minLengthForThumb = [painter knobMinLength] + [painter trackOverlapEndIn
set] + [painter knobOverlapEndInset] |
227 + 2 * ([painter trackEndInset] + [painter knobEndInset]); | 227 + 2 * ([painter trackEndInset] + [painter knobEndInset]); |
228 return scrollbar->enabled() && (scrollbar->orientation() == HorizontalScroll
bar ? | 228 return scrollbar->enabled() && (scrollbar->orientation() == HorizontalScroll
bar ? |
229 scrollbar->width() : | 229 scrollbar->width() : |
230 scrollbar->height()) >= minLengthForThumb; | 230 scrollbar->height()) >= minLengthForThumb; |
231 } | 231 } |
232 | 232 |
233 IntRect ScrollbarThemeMacOverlayAPI::backButtonRect(ScrollbarThemeClient* scroll
bar, ScrollbarPart part, bool painting) | 233 IntRect ScrollbarThemeMacOverlayAPI::backButtonRect(ScrollbarThemeClient* scroll
bar, ScrollbarPart part, bool painting) |
234 { | 234 { |
235 ASSERT(buttonsPlacement() == ScrollbarButtonsNone); | 235 ASSERT(buttonsPlacement() == ScrollbarButtonsPlacementNone); |
236 return IntRect(); | 236 return IntRect(); |
237 } | 237 } |
238 | 238 |
239 IntRect ScrollbarThemeMacOverlayAPI::forwardButtonRect(ScrollbarThemeClient* scr
ollbar, ScrollbarPart part, bool painting) | 239 IntRect ScrollbarThemeMacOverlayAPI::forwardButtonRect(ScrollbarThemeClient* scr
ollbar, ScrollbarPart part, bool painting) |
240 { | 240 { |
241 ASSERT(buttonsPlacement() == ScrollbarButtonsNone); | 241 ASSERT(buttonsPlacement() == ScrollbarButtonsPlacementNone); |
242 return IntRect(); | 242 return IntRect(); |
243 } | 243 } |
244 | 244 |
245 IntRect ScrollbarThemeMacOverlayAPI::trackRect(ScrollbarThemeClient* scrollbar,
bool painting) | 245 IntRect ScrollbarThemeMacOverlayAPI::trackRect(ScrollbarThemeClient* scrollbar,
bool painting) |
246 { | 246 { |
247 ASSERT(!hasButtons(scrollbar)); | 247 ASSERT(!hasButtons(scrollbar)); |
248 return scrollbar->frameRect(); | 248 return scrollbar->frameRect(); |
249 } | 249 } |
250 | 250 |
251 int ScrollbarThemeMacOverlayAPI::minimumThumbLength(ScrollbarThemeClient* scroll
bar) | 251 int ScrollbarThemeMacOverlayAPI::minimumThumbLength(ScrollbarThemeClient* scroll
bar) |
252 { | 252 { |
253 return [painterForScrollbar(scrollbar) knobMinLength]; | 253 return [painterForScrollbar(scrollbar) knobMinLength]; |
254 } | 254 } |
255 | 255 |
256 void ScrollbarThemeMacOverlayAPI::updateEnabledState(ScrollbarThemeClient* scrol
lbar) | 256 void ScrollbarThemeMacOverlayAPI::updateEnabledState(ScrollbarThemeClient* scrol
lbar) |
257 { | 257 { |
258 [painterForScrollbar(scrollbar) setEnabled:scrollbar->enabled()]; | 258 [painterForScrollbar(scrollbar) setEnabled:scrollbar->enabled()]; |
259 } | 259 } |
260 | 260 |
261 } // namespace blink | 261 } // namespace blink |
262 | 262 |
OLD | NEW |