Chromium Code Reviews| 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 209 | 209 |
| 210 - (NSRect)contentAreaRectForScrollerImpPair:(id)scrollerImpPair | 210 - (NSRect)contentAreaRectForScrollerImpPair:(id)scrollerImpPair |
| 211 { | 211 { |
| 212 if (!_scrollableArea) | 212 if (!_scrollableArea) |
| 213 return NSZeroRect; | 213 return NSZeroRect; |
| 214 | 214 |
| 215 blink::IntSize contentsSize = _scrollableArea->contentsSize(); | 215 blink::IntSize contentsSize = _scrollableArea->contentsSize(); |
| 216 return NSMakeRect(0, 0, contentsSize.width(), contentsSize.height()); | 216 return NSMakeRect(0, 0, contentsSize.width(), contentsSize.height()); |
| 217 } | 217 } |
| 218 | 218 |
| 219 - (BOOL)inLiveResizeForScrollerImpPair:(id)scrollerImpPair | |
|
Stephen Chennney
2016/03/04 17:36:56
This is part of the implementation for BlinkScroll
Mark Dittmer
2016/03/04 19:06:24
Thanks. I've since added it back (with the trivial
| |
| 220 { | |
| 221 if (!_scrollableArea) | |
| 222 return NO; | |
| 223 | |
| 224 return _scrollableArea->inLiveResize(); | |
| 225 } | |
| 226 | |
| 227 - (NSPoint)mouseLocationInContentAreaForScrollerImpPair:(id)scrollerImpPair | 219 - (NSPoint)mouseLocationInContentAreaForScrollerImpPair:(id)scrollerImpPair |
| 228 { | 220 { |
| 229 if (!_scrollableArea) | 221 if (!_scrollableArea) |
| 230 return NSZeroPoint; | 222 return NSZeroPoint; |
| 231 | 223 |
| 232 return _scrollableArea->lastKnownMousePosition(); | 224 return _scrollableArea->lastKnownMousePosition(); |
| 233 } | 225 } |
| 234 | 226 |
| 235 - (NSPoint)scrollerImpPair:(id)scrollerImpPair convertContentPoint:(NSPoint)poin tInContentArea toScrollerImp:(id)scrollerImp | 227 - (NSPoint)scrollerImpPair:(id)scrollerImpPair convertContentPoint:(NSPoint)poin tInContentArea toScrollerImp:(id)scrollerImp |
| 236 { | 228 { |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 854 return; | 846 return; |
| 855 | 847 |
| 856 if (ScrollbarThemeMacCommon::isOverlayAPIAvailable()) { | 848 if (ScrollbarThemeMacCommon::isOverlayAPIAvailable()) { |
| 857 if (!supportsUIStateTransitionProgress()) | 849 if (!supportsUIStateTransitionProgress()) |
| 858 return; | 850 return; |
| 859 if (ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar)) | 851 if (ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar)) |
| 860 [painter mouseExitedScroller]; | 852 [painter mouseExitedScroller]; |
| 861 } | 853 } |
| 862 } | 854 } |
| 863 | 855 |
| 864 void ScrollAnimatorMac::willStartLiveResize() | |
| 865 { | |
| 866 if (!scrollableArea()->scrollbarsCanBeActive()) | |
| 867 return; | |
| 868 if (ScrollbarThemeMacCommon::isOverlayAPIAvailable()) | |
| 869 [m_scrollbarPainterController.get() startLiveResize]; | |
| 870 } | |
| 871 | |
| 872 void ScrollAnimatorMac::contentsResized() const | 856 void ScrollAnimatorMac::contentsResized() const |
| 873 { | 857 { |
| 874 if (!scrollableArea()->scrollbarsCanBeActive()) | 858 if (!scrollableArea()->scrollbarsCanBeActive()) |
| 875 return; | 859 return; |
| 876 if (ScrollbarThemeMacCommon::isOverlayAPIAvailable()) | 860 if (ScrollbarThemeMacCommon::isOverlayAPIAvailable()) |
| 877 [m_scrollbarPainterController.get() contentAreaDidResize]; | 861 [m_scrollbarPainterController.get() contentAreaDidResize]; |
| 878 } | 862 } |
| 879 | 863 |
| 880 void ScrollAnimatorMac::willEndLiveResize() | |
| 881 { | |
| 882 if (!scrollableArea()->scrollbarsCanBeActive()) | |
| 883 return; | |
| 884 if (ScrollbarThemeMacCommon::isOverlayAPIAvailable()) | |
| 885 [m_scrollbarPainterController.get() endLiveResize]; | |
| 886 } | |
| 887 | |
| 888 void ScrollAnimatorMac::contentAreaDidShow() const | 864 void ScrollAnimatorMac::contentAreaDidShow() const |
| 889 { | 865 { |
| 890 if (!scrollableArea()->scrollbarsCanBeActive()) | 866 if (!scrollableArea()->scrollbarsCanBeActive()) |
| 891 return; | 867 return; |
| 892 if (ScrollbarThemeMacCommon::isOverlayAPIAvailable()) | 868 if (ScrollbarThemeMacCommon::isOverlayAPIAvailable()) |
| 893 [m_scrollbarPainterController.get() windowOrderedIn]; | 869 [m_scrollbarPainterController.get() windowOrderedIn]; |
| 894 } | 870 } |
| 895 | 871 |
| 896 void ScrollAnimatorMac::contentAreaDidHide() const | 872 void ScrollAnimatorMac::contentAreaDidHide() const |
| 897 { | 873 { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 942 | 918 |
| 943 ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar); | 919 ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar); |
| 944 if (!painter) | 920 if (!painter) |
| 945 return; | 921 return; |
| 946 | 922 |
| 947 ASSERT(!m_verticalScrollbarPainterDelegate); | 923 ASSERT(!m_verticalScrollbarPainterDelegate); |
| 948 m_verticalScrollbarPainterDelegate.adoptNS([[BlinkScrollbarPainterDelegate a lloc] initWithScrollbar:&scrollbar]); | 924 m_verticalScrollbarPainterDelegate.adoptNS([[BlinkScrollbarPainterDelegate a lloc] initWithScrollbar:&scrollbar]); |
| 949 | 925 |
| 950 [painter setDelegate:m_verticalScrollbarPainterDelegate.get()]; | 926 [painter setDelegate:m_verticalScrollbarPainterDelegate.get()]; |
| 951 [m_scrollbarPainterController.get() setVerticalScrollerImp:painter]; | 927 [m_scrollbarPainterController.get() setVerticalScrollerImp:painter]; |
| 952 if (scrollableArea()->inLiveResize()) | |
| 953 [painter setKnobAlpha:1]; | |
| 954 } | 928 } |
| 955 | 929 |
| 956 void ScrollAnimatorMac::willRemoveVerticalScrollbar(Scrollbar& scrollbar) | 930 void ScrollAnimatorMac::willRemoveVerticalScrollbar(Scrollbar& scrollbar) |
| 957 { | 931 { |
| 958 if (!ScrollbarThemeMacCommon::isOverlayAPIAvailable()) | 932 if (!ScrollbarThemeMacCommon::isOverlayAPIAvailable()) |
| 959 return; | 933 return; |
| 960 | 934 |
| 961 ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar); | 935 ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar); |
| 962 if (!painter) | 936 if (!painter) |
| 963 return; | 937 return; |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 977 | 951 |
| 978 ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar); | 952 ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar); |
| 979 if (!painter) | 953 if (!painter) |
| 980 return; | 954 return; |
| 981 | 955 |
| 982 ASSERT(!m_horizontalScrollbarPainterDelegate); | 956 ASSERT(!m_horizontalScrollbarPainterDelegate); |
| 983 m_horizontalScrollbarPainterDelegate.adoptNS([[BlinkScrollbarPainterDelegate alloc] initWithScrollbar:&scrollbar]); | 957 m_horizontalScrollbarPainterDelegate.adoptNS([[BlinkScrollbarPainterDelegate alloc] initWithScrollbar:&scrollbar]); |
| 984 | 958 |
| 985 [painter setDelegate:m_horizontalScrollbarPainterDelegate.get()]; | 959 [painter setDelegate:m_horizontalScrollbarPainterDelegate.get()]; |
| 986 [m_scrollbarPainterController.get() setHorizontalScrollerImp:painter]; | 960 [m_scrollbarPainterController.get() setHorizontalScrollerImp:painter]; |
| 987 if (scrollableArea()->inLiveResize()) | |
| 988 [painter setKnobAlpha:1]; | |
| 989 } | 961 } |
| 990 | 962 |
| 991 void ScrollAnimatorMac::willRemoveHorizontalScrollbar(Scrollbar& scrollbar) | 963 void ScrollAnimatorMac::willRemoveHorizontalScrollbar(Scrollbar& scrollbar) |
| 992 { | 964 { |
| 993 if (!ScrollbarThemeMacCommon::isOverlayAPIAvailable()) | 965 if (!ScrollbarThemeMacCommon::isOverlayAPIAvailable()) |
| 994 return; | 966 return; |
| 995 | 967 |
| 996 ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar); | 968 ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar); |
| 997 if (!painter) | 969 if (!painter) |
| 998 return; | 970 return; |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1182 return; | 1154 return; |
| 1183 | 1155 |
| 1184 m_visibleScrollerThumbRect = rectInViewCoordinates; | 1156 m_visibleScrollerThumbRect = rectInViewCoordinates; |
| 1185 } | 1157 } |
| 1186 | 1158 |
| 1187 bool ScrollAnimatorMac::canUseCoordinatedScrollbar() { | 1159 bool ScrollAnimatorMac::canUseCoordinatedScrollbar() { |
| 1188 return ScrollbarThemeMacCommon::isOverlayAPIAvailable(); | 1160 return ScrollbarThemeMacCommon::isOverlayAPIAvailable(); |
| 1189 } | 1161 } |
| 1190 | 1162 |
| 1191 } // namespace blink | 1163 } // namespace blink |
| OLD | NEW |