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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 } | 60 } |
61 | 61 |
62 ScrollableArea::ScrollableArea() | 62 ScrollableArea::ScrollableArea() |
63 : m_scrollbarOverlayColorTheme(ScrollbarOverlayColorThemeDark), | 63 : m_scrollbarOverlayColorTheme(ScrollbarOverlayColorThemeDark), |
64 m_scrollOriginChanged(false), | 64 m_scrollOriginChanged(false), |
65 m_horizontalScrollbarNeedsPaintInvalidation(false), | 65 m_horizontalScrollbarNeedsPaintInvalidation(false), |
66 m_verticalScrollbarNeedsPaintInvalidation(false), | 66 m_verticalScrollbarNeedsPaintInvalidation(false), |
67 m_scrollCornerNeedsPaintInvalidation(false), | 67 m_scrollCornerNeedsPaintInvalidation(false), |
68 m_scrollbarsHidden(false), | 68 m_scrollbarsHidden(false), |
69 m_scrollbarCaptured(false), | 69 m_scrollbarCaptured(false), |
70 m_mouseOverScrollbar(false) {} | 70 m_mouseOverScrollbar(false), |
| 71 m_needsShowScrollbarLayers(false) {} |
71 | 72 |
72 ScrollableArea::~ScrollableArea() {} | 73 ScrollableArea::~ScrollableArea() {} |
73 | 74 |
74 void ScrollableArea::clearScrollableArea() { | 75 void ScrollableArea::clearScrollableArea() { |
75 #if OS(MACOSX) | 76 #if OS(MACOSX) |
76 if (m_scrollAnimator) | 77 if (m_scrollAnimator) |
77 m_scrollAnimator->dispose(); | 78 m_scrollAnimator->dispose(); |
78 #endif | 79 #endif |
79 m_scrollAnimator.clear(); | 80 m_scrollAnimator.clear(); |
80 m_programmaticScrollAnimator.clear(); | 81 m_programmaticScrollAnimator.clear(); |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 | 559 |
559 void ScrollableArea::fadeOverlayScrollbarsTimerFired(TimerBase*) { | 560 void ScrollableArea::fadeOverlayScrollbarsTimerFired(TimerBase*) { |
560 setScrollbarsHidden(true); | 561 setScrollbarsHidden(true); |
561 } | 562 } |
562 | 563 |
563 void ScrollableArea::showOverlayScrollbars() { | 564 void ScrollableArea::showOverlayScrollbars() { |
564 if (!ScrollbarTheme::theme().usesOverlayScrollbars()) | 565 if (!ScrollbarTheme::theme().usesOverlayScrollbars()) |
565 return; | 566 return; |
566 | 567 |
567 setScrollbarsHidden(false); | 568 setScrollbarsHidden(false); |
| 569 m_needsShowScrollbarLayers = true; |
568 | 570 |
569 const double timeUntilDisable = | 571 const double timeUntilDisable = |
570 ScrollbarTheme::theme().overlayScrollbarFadeOutDelaySeconds() + | 572 ScrollbarTheme::theme().overlayScrollbarFadeOutDelaySeconds() + |
571 ScrollbarTheme::theme().overlayScrollbarFadeOutDurationSeconds(); | 573 ScrollbarTheme::theme().overlayScrollbarFadeOutDurationSeconds(); |
572 | 574 |
573 // If the overlay scrollbars don't fade out, don't do anything. This is the | 575 // If the overlay scrollbars don't fade out, don't do anything. This is the |
574 // case for the mock overlays used in tests and on Mac, where the fade-out is | 576 // case for the mock overlays used in tests and on Mac, where the fade-out is |
575 // animated in ScrollAnimatorMac. | 577 // animated in ScrollAnimatorMac. |
576 if (!timeUntilDisable) | 578 if (!timeUntilDisable) |
577 return; | 579 return; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 offset.y() - scrollOrigin().y()); | 669 offset.y() - scrollOrigin().y()); |
668 setScrollOffset(newOffset, CompositorScroll); | 670 setScrollOffset(newOffset, CompositorScroll); |
669 } | 671 } |
670 | 672 |
671 DEFINE_TRACE(ScrollableArea) { | 673 DEFINE_TRACE(ScrollableArea) { |
672 visitor->trace(m_scrollAnimator); | 674 visitor->trace(m_scrollAnimator); |
673 visitor->trace(m_programmaticScrollAnimator); | 675 visitor->trace(m_programmaticScrollAnimator); |
674 } | 676 } |
675 | 677 |
676 } // namespace blink | 678 } // namespace blink |
OLD | NEW |