| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, Google Inc. All rights reserved. |
| 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. | 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 } | 312 } |
| 313 | 313 |
| 314 void ScrollableArea::contentsResized() | 314 void ScrollableArea::contentsResized() |
| 315 { | 315 { |
| 316 if (ScrollAnimator* scrollAnimator = existingScrollAnimator()) | 316 if (ScrollAnimator* scrollAnimator = existingScrollAnimator()) |
| 317 scrollAnimator->contentsResized(); | 317 scrollAnimator->contentsResized(); |
| 318 } | 318 } |
| 319 | 319 |
| 320 bool ScrollableArea::hasOverlayScrollbars() const | 320 bool ScrollableArea::hasOverlayScrollbars() const |
| 321 { | 321 { |
| 322 return (verticalScrollbar() && verticalScrollbar()->isOverlayScrollbar()) | 322 Scrollbar* vScrollbar = verticalScrollbar(); |
| 323 || (horizontalScrollbar() && horizontalScrollbar()->isOverlayScrollbar()
); | 323 if (vScrollbar && vScrollbar->isOverlayScrollbar()) |
| 324 return true; |
| 325 Scrollbar* hScrollbar = horizontalScrollbar(); |
| 326 return hScrollbar && hScrollbar->isOverlayScrollbar(); |
| 324 } | 327 } |
| 325 | 328 |
| 326 void ScrollableArea::setScrollbarOverlayStyle(ScrollbarOverlayStyle overlayStyle
) | 329 void ScrollableArea::setScrollbarOverlayStyle(ScrollbarOverlayStyle overlayStyle
) |
| 327 { | 330 { |
| 328 m_scrollbarOverlayStyle = overlayStyle; | 331 m_scrollbarOverlayStyle = overlayStyle; |
| 329 | 332 |
| 330 if (horizontalScrollbar()) { | 333 if (Scrollbar* scrollbar = horizontalScrollbar()) { |
| 331 ScrollbarTheme::theme()->updateScrollbarOverlayStyle(horizontalScrollbar
()); | 334 ScrollbarTheme::theme()->updateScrollbarOverlayStyle(scrollbar); |
| 332 horizontalScrollbar()->invalidate(); | 335 scrollbar->invalidate(); |
| 333 } | 336 } |
| 334 | 337 |
| 335 if (verticalScrollbar()) { | 338 if (Scrollbar* scrollbar = verticalScrollbar()) { |
| 336 ScrollbarTheme::theme()->updateScrollbarOverlayStyle(verticalScrollbar()
); | 339 ScrollbarTheme::theme()->updateScrollbarOverlayStyle(scrollbar); |
| 337 verticalScrollbar()->invalidate(); | 340 scrollbar->invalidate(); |
| 338 } | 341 } |
| 339 } | 342 } |
| 340 | 343 |
| 341 void ScrollableArea::invalidateScrollbar(Scrollbar* scrollbar, const IntRect& re
ct) | 344 void ScrollableArea::invalidateScrollbar(Scrollbar* scrollbar, const IntRect& re
ct) |
| 342 { | 345 { |
| 343 if (scrollbar == horizontalScrollbar()) { | 346 if (scrollbar == horizontalScrollbar()) { |
| 344 if (GraphicsLayer* graphicsLayer = layerForHorizontalScrollbar()) { | 347 if (GraphicsLayer* graphicsLayer = layerForHorizontalScrollbar()) { |
| 345 graphicsLayer->setNeedsDisplay(); | 348 graphicsLayer->setNeedsDisplay(); |
| 346 graphicsLayer->setContentsNeedsDisplay(); | 349 graphicsLayer->setContentsNeedsDisplay(); |
| 347 return; | 350 return; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 { | 421 { |
| 419 return scrollSize(orientation); | 422 return scrollSize(orientation); |
| 420 } | 423 } |
| 421 | 424 |
| 422 float ScrollableArea::pixelStep(ScrollbarOrientation) const | 425 float ScrollableArea::pixelStep(ScrollbarOrientation) const |
| 423 { | 426 { |
| 424 return 1; | 427 return 1; |
| 425 } | 428 } |
| 426 | 429 |
| 427 } // namespace WebCore | 430 } // namespace WebCore |
| OLD | NEW |