| 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 } | 382 } |
| 383 } | 383 } |
| 384 | 384 |
| 385 void ScrollableArea::contentsResized() { | 385 void ScrollableArea::contentsResized() { |
| 386 showOverlayScrollbars(); | 386 showOverlayScrollbars(); |
| 387 if (ScrollAnimatorBase* scrollAnimator = existingScrollAnimator()) | 387 if (ScrollAnimatorBase* scrollAnimator = existingScrollAnimator()) |
| 388 scrollAnimator->contentsResized(); | 388 scrollAnimator->contentsResized(); |
| 389 } | 389 } |
| 390 | 390 |
| 391 bool ScrollableArea::hasOverlayScrollbars() const { | 391 bool ScrollableArea::hasOverlayScrollbars() const { |
| 392 Scrollbar* vScrollbar = verticalScrollbar(); | 392 return (horizontalScrollbar() && |
| 393 if (vScrollbar && vScrollbar->isOverlayScrollbar()) | 393 horizontalScrollbar()->isOverlayScrollbar()) || |
| 394 return true; | 394 (verticalScrollbar() && verticalScrollbar()->isOverlayScrollbar()); |
| 395 Scrollbar* hScrollbar = horizontalScrollbar(); | |
| 396 return hScrollbar && hScrollbar->isOverlayScrollbar(); | |
| 397 } | 395 } |
| 398 | 396 |
| 399 void ScrollableArea::setScrollbarOverlayColorTheme( | 397 void ScrollableArea::setScrollbarOverlayColorTheme( |
| 400 ScrollbarOverlayColorTheme overlayTheme) { | 398 ScrollbarOverlayColorTheme overlayTheme) { |
| 401 m_scrollbarOverlayColorTheme = overlayTheme; | 399 m_scrollbarOverlayColorTheme = overlayTheme; |
| 402 | 400 |
| 403 if (Scrollbar* scrollbar = horizontalScrollbar()) { | 401 if (Scrollbar* scrollbar = horizontalScrollbar()) { |
| 404 ScrollbarTheme::theme().updateScrollbarOverlayColorTheme(*scrollbar); | 402 ScrollbarTheme::theme().updateScrollbarOverlayColorTheme(*scrollbar); |
| 405 scrollbar->setNeedsPaintInvalidation(AllParts); | 403 scrollbar->setNeedsPaintInvalidation(AllParts); |
| 406 } | 404 } |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 return IntSize(std::max(0, size.width() - verticalScrollbarWidth()), | 652 return IntSize(std::max(0, size.width() - verticalScrollbarWidth()), |
| 655 std::max(0, size.height() - horizontalScrollbarHeight())); | 653 std::max(0, size.height() - horizontalScrollbarHeight())); |
| 656 } | 654 } |
| 657 | 655 |
| 658 DEFINE_TRACE(ScrollableArea) { | 656 DEFINE_TRACE(ScrollableArea) { |
| 659 visitor->trace(m_scrollAnimator); | 657 visitor->trace(m_scrollAnimator); |
| 660 visitor->trace(m_programmaticScrollAnimator); | 658 visitor->trace(m_programmaticScrollAnimator); |
| 661 } | 659 } |
| 662 | 660 |
| 663 } // namespace blink | 661 } // namespace blink |
| OLD | NEW |