| 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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 ScrollbarPart invalidParts = NoPart; | 316 ScrollbarPart invalidParts = NoPart; |
| 317 ASSERT(buttonsPlacement() == WebScrollbarButtonsPlacementSingle); | 317 ASSERT(buttonsPlacement() == WebScrollbarButtonsPlacementSingle); |
| 318 static const ScrollbarPart kButtonParts[] = {BackButtonStartPart, ForwardBut
tonEndPart}; | 318 static const ScrollbarPart kButtonParts[] = {BackButtonStartPart, ForwardBut
tonEndPart}; |
| 319 for (ScrollbarPart part : kButtonParts) { | 319 for (ScrollbarPart part : kButtonParts) { |
| 320 if (buttonPartPaintingParams(scrollbar, oldPosition, part) != buttonPart
PaintingParams(scrollbar, newPosition, part)) | 320 if (buttonPartPaintingParams(scrollbar, oldPosition, part) != buttonPart
PaintingParams(scrollbar, newPosition, part)) |
| 321 invalidParts = static_cast<ScrollbarPart>(invalidParts | part); | 321 invalidParts = static_cast<ScrollbarPart>(invalidParts | part); |
| 322 } | 322 } |
| 323 return invalidParts; | 323 return invalidParts; |
| 324 } | 324 } |
| 325 | 325 |
| 326 bool ScrollbarThemeAura::hasScrollbarButtons(ScrollbarOrientation orientation) c
onst |
| 327 { |
| 328 WebThemeEngine* themeEngine = Platform::current()->themeEngine(); |
| 329 if (orientation == VerticalScrollbar) { |
| 330 return !themeEngine->getSize(WebThemeEngine::PartScrollbarDownArrow).isE
mpty(); |
| 331 } |
| 332 return !themeEngine->getSize(WebThemeEngine::PartScrollbarLeftArrow).isEmpty
(); |
| 333 }; |
| 334 |
| 326 IntSize ScrollbarThemeAura::buttonSize(const ScrollbarThemeClient& scrollbar) | 335 IntSize ScrollbarThemeAura::buttonSize(const ScrollbarThemeClient& scrollbar) |
| 327 { | 336 { |
| 337 if (!hasScrollbarButtons(scrollbar.orientation())) |
| 338 return IntSize(0, 0); |
| 339 |
| 328 if (scrollbar.orientation() == VerticalScrollbar) { | 340 if (scrollbar.orientation() == VerticalScrollbar) { |
| 329 int squareSize = scrollbar.width(); | 341 int squareSize = scrollbar.width(); |
| 330 return IntSize(squareSize, scrollbar.height() < 2 * squareSize ? scrollb
ar.height() / 2 : squareSize); | 342 return IntSize(squareSize, scrollbar.height() < 2 * squareSize ? scrollb
ar.height() / 2 : squareSize); |
| 331 } | 343 } |
| 332 | 344 |
| 333 // HorizontalScrollbar | 345 // HorizontalScrollbar |
| 334 int squareSize = scrollbar.height(); | 346 int squareSize = scrollbar.height(); |
| 335 return IntSize(scrollbar.width() < 2 * squareSize ? scrollbar.width() / 2 :
squareSize, squareSize); | 347 return IntSize(scrollbar.width() < 2 * squareSize ? scrollbar.width() / 2 :
squareSize, squareSize); |
| 336 } | 348 } |
| 337 | 349 |
| 338 } // namespace blink | 350 } // namespace blink |
| OLD | NEW |