OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010, 2011 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 return; | 945 return; |
946 | 946 |
947 ASSERT(m_horizontalScrollbarPainterDelegate); | 947 ASSERT(m_horizontalScrollbarPainterDelegate); |
948 [m_horizontalScrollbarPainterDelegate.get() invalidate]; | 948 [m_horizontalScrollbarPainterDelegate.get() invalidate]; |
949 m_horizontalScrollbarPainterDelegate = nullptr; | 949 m_horizontalScrollbarPainterDelegate = nullptr; |
950 | 950 |
951 [painter setDelegate:nil]; | 951 [painter setDelegate:nil]; |
952 [m_scrollbarPainterController.get() setHorizontalScrollerImp:nil]; | 952 [m_scrollbarPainterController.get() setHorizontalScrollerImp:nil]; |
953 } | 953 } |
954 | 954 |
955 bool ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting( | |
956 Scrollbar& scrollbar) { | |
957 // Non-overlay scrollbars should always participate in hit testing. | |
958 if (ScrollbarThemeMac::recommendedScrollerStyle() != NSScrollerStyleOverlay) | |
959 return true; | |
960 | |
961 // Overlay scrollbars should participate in hit testing whenever they are at | |
962 // all visible. | |
963 ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar); | |
964 if (!painter) | |
965 return false; | |
966 return [painter knobAlpha] > 0; | |
967 } | |
968 | |
969 void ScrollAnimatorMac::notifyContentAreaScrolled(const ScrollOffset& delta) { | 955 void ScrollAnimatorMac::notifyContentAreaScrolled(const ScrollOffset& delta) { |
970 // This function is called when a page is going into the page cache, but the | 956 // This function is called when a page is going into the page cache, but the |
971 // page | 957 // page |
972 // isn't really scrolling in that case. We should only pass the message on to | 958 // isn't really scrolling in that case. We should only pass the message on to |
973 // the | 959 // the |
974 // ScrollbarPainterController when we're really scrolling on an active page. | 960 // ScrollbarPainterController when we're really scrolling on an active page. |
975 if (getScrollableArea()->scrollbarsCanBeActive()) | 961 if (getScrollableArea()->scrollbarsCanBeActive()) |
976 sendContentAreaScrolledSoon(delta); | 962 sendContentAreaScrolledSoon(delta); |
977 } | 963 } |
978 | 964 |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1132 rectInViewCoordinates = | 1118 rectInViewCoordinates = |
1133 verticalScrollbar->convertToContainingWidget(scrollerThumb); | 1119 verticalScrollbar->convertToContainingWidget(scrollerThumb); |
1134 | 1120 |
1135 if (rectInViewCoordinates == m_visibleScrollerThumbRect) | 1121 if (rectInViewCoordinates == m_visibleScrollerThumbRect) |
1136 return; | 1122 return; |
1137 | 1123 |
1138 m_visibleScrollerThumbRect = rectInViewCoordinates; | 1124 m_visibleScrollerThumbRect = rectInViewCoordinates; |
1139 } | 1125 } |
1140 | 1126 |
1141 } // namespace blink | 1127 } // namespace blink |
OLD | NEW |