Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Side by Side Diff: third_party/WebKit/Source/platform/mac/ScrollAnimatorMac.mm

Issue 1486743002: Clean up some remaining obsolete coordinate-space naming. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Mac compile Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 // It is possible to have a null scrollbar here since it is possible for thi s delegate 246 // It is possible to have a null scrollbar here since it is possible for thi s delegate
247 // method to be called between the moment when a scrollbar has been set to 0 and the 247 // method to be called between the moment when a scrollbar has been set to 0 and the
248 // moment when its destructor has been called. We should probably de-couple some 248 // moment when its destructor has been called. We should probably de-couple some
249 // of the clean-up work in ScrollbarThemeMac::unregisterScrollbar() to avoid this 249 // of the clean-up work in ScrollbarThemeMac::unregisterScrollbar() to avoid this
250 // issue. 250 // issue.
251 if (!scrollbar) 251 if (!scrollbar)
252 return NSZeroPoint; 252 return NSZeroPoint;
253 253
254 ASSERT(scrollerImp == scrollbarPainterForScrollbar(scrollbar)); 254 ASSERT(scrollerImp == scrollbarPainterForScrollbar(scrollbar));
255 255
256 return scrollbar->convertFromContainingView(blink::IntPoint(pointInContentAr ea)); 256 return scrollbar->convertFromContainingWidget(blink::IntPoint(pointInContent Area));
257 } 257 }
258 258
259 - (void)scrollerImpPair:(id)scrollerImpPair setContentAreaNeedsDisplayInRect:(NS Rect)rect 259 - (void)scrollerImpPair:(id)scrollerImpPair setContentAreaNeedsDisplayInRect:(NS Rect)rect
260 { 260 {
261 if (!_scrollableArea) 261 if (!_scrollableArea)
262 return; 262 return;
263 263
264 if (!_scrollableArea->scrollbarsCanBeActive()) 264 if (!_scrollableArea->scrollbarsCanBeActive())
265 return; 265 return;
266 266
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 return aRect; 514 return aRect;
515 } 515 }
516 516
517 - (NSPoint)mouseLocationInScrollerForScrollerImp:(id)scrollerImp 517 - (NSPoint)mouseLocationInScrollerForScrollerImp:(id)scrollerImp
518 { 518 {
519 if (!_scrollbar) 519 if (!_scrollbar)
520 return NSZeroPoint; 520 return NSZeroPoint;
521 521
522 ASSERT_UNUSED(scrollerImp, scrollerImp == scrollbarPainterForScrollbar(_scro llbar)); 522 ASSERT_UNUSED(scrollerImp, scrollerImp == scrollbarPainterForScrollbar(_scro llbar));
523 523
524 return _scrollbar->convertFromContainingView(_scrollbar->scrollableArea()->l astKnownMousePosition()); 524 return _scrollbar->convertFromContainingWidget(_scrollbar->scrollableArea()- >lastKnownMousePosition());
525 } 525 }
526 526
527 - (void)setUpAlphaAnimation:(RetainPtr<WebScrollbarPartAnimation>&)scrollbarPart Animation scrollerPainter:(ScrollbarPainter)scrollerPainter part:(blink::Scrollb arPart)part animateAlphaTo:(CGFloat)newAlpha duration:(NSTimeInterval)duration 527 - (void)setUpAlphaAnimation:(RetainPtr<WebScrollbarPartAnimation>&)scrollbarPart Animation scrollerPainter:(ScrollbarPainter)scrollerPainter part:(blink::Scrollb arPart)part animateAlphaTo:(CGFloat)newAlpha duration:(NSTimeInterval)duration
528 { 528 {
529 // If the user has scrolled the page, then the scrollbars must be animated h ere. 529 // If the user has scrolled the page, then the scrollbars must be animated h ere.
530 // This overrides the early returns. 530 // This overrides the early returns.
531 bool mustAnimate = [self scrollAnimator]->haveScrolledSincePageLoad(); 531 bool mustAnimate = [self scrollAnimator]->haveScrolledSincePageLoad();
532 532
533 if ([self scrollAnimator]->scrollbarPaintTimerIsActive() && !mustAnimate) 533 if ([self scrollAnimator]->scrollbarPaintTimerIsActive() && !mustAnimate)
534 return; 534 return;
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 [m_scrollbarPainterController.get() contentAreaScrolledInDirection:NSMak ePoint(m_contentAreaScrolledTimerScrollDelta.width(), m_contentAreaScrolledTimer ScrollDelta.height())]; 1175 [m_scrollbarPainterController.get() contentAreaScrolledInDirection:NSMak ePoint(m_contentAreaScrolledTimerScrollDelta.width(), m_contentAreaScrolledTimer ScrollDelta.height())];
1176 m_contentAreaScrolledTimerScrollDelta = FloatSize(); 1176 m_contentAreaScrolledTimerScrollDelta = FloatSize();
1177 } else 1177 } else
1178 [m_scrollbarPainterController.get() contentAreaScrolled]; 1178 [m_scrollbarPainterController.get() contentAreaScrolled];
1179 } 1179 }
1180 1180
1181 void ScrollAnimatorMac::setVisibleScrollerThumbRect(const IntRect& scrollerThumb ) 1181 void ScrollAnimatorMac::setVisibleScrollerThumbRect(const IntRect& scrollerThumb )
1182 { 1182 {
1183 IntRect rectInViewCoordinates = scrollerThumb; 1183 IntRect rectInViewCoordinates = scrollerThumb;
1184 if (Scrollbar* verticalScrollbar = m_scrollableArea->verticalScrollbar()) 1184 if (Scrollbar* verticalScrollbar = m_scrollableArea->verticalScrollbar())
1185 rectInViewCoordinates = verticalScrollbar->convertToContainingView(scrol lerThumb); 1185 rectInViewCoordinates = verticalScrollbar->convertToContainingWidget(scr ollerThumb);
1186 1186
1187 if (rectInViewCoordinates == m_visibleScrollerThumbRect) 1187 if (rectInViewCoordinates == m_visibleScrollerThumbRect)
1188 return; 1188 return;
1189 1189
1190 m_visibleScrollerThumbRect = rectInViewCoordinates; 1190 m_visibleScrollerThumbRect = rectInViewCoordinates;
1191 } 1191 }
1192 1192
1193 bool ScrollAnimatorMac::canUseCoordinatedScrollbar() { 1193 bool ScrollAnimatorMac::canUseCoordinatedScrollbar() {
1194 return ScrollbarThemeMacCommon::isOverlayAPIAvailable(); 1194 return ScrollbarThemeMacCommon::isOverlayAPIAvailable();
1195 } 1195 }
1196 1196
1197 } // namespace blink 1197 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698