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 |
955 void ScrollAnimatorMac::notifyContentAreaScrolled(const ScrollOffset& delta) { | 969 void ScrollAnimatorMac::notifyContentAreaScrolled(const ScrollOffset& delta) { |
956 // This function is called when a page is going into the page cache, but the | 970 // This function is called when a page is going into the page cache, but the |
957 // page | 971 // page |
958 // isn't really scrolling in that case. We should only pass the message on to | 972 // isn't really scrolling in that case. We should only pass the message on to |
959 // the | 973 // the |
960 // ScrollbarPainterController when we're really scrolling on an active page. | 974 // ScrollbarPainterController when we're really scrolling on an active page. |
961 if (getScrollableArea()->scrollbarsCanBeActive()) | 975 if (getScrollableArea()->scrollbarsCanBeActive()) |
962 sendContentAreaScrolledSoon(delta); | 976 sendContentAreaScrolledSoon(delta); |
963 } | 977 } |
964 | 978 |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 rectInViewCoordinates = | 1132 rectInViewCoordinates = |
1119 verticalScrollbar->convertToContainingWidget(scrollerThumb); | 1133 verticalScrollbar->convertToContainingWidget(scrollerThumb); |
1120 | 1134 |
1121 if (rectInViewCoordinates == m_visibleScrollerThumbRect) | 1135 if (rectInViewCoordinates == m_visibleScrollerThumbRect) |
1122 return; | 1136 return; |
1123 | 1137 |
1124 m_visibleScrollerThumbRect = rectInViewCoordinates; | 1138 m_visibleScrollerThumbRect = rectInViewCoordinates; |
1125 } | 1139 } |
1126 | 1140 |
1127 } // namespace blink | 1141 } // namespace blink |
OLD | NEW |