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

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

Issue 1161713004: Rename ScrollableArea::scroll to userScroll (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed comment Created 5 years, 6 months 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
« no previous file with comments | « Source/platform/mac/ScrollAnimatorMac.h ('k') | Source/platform/scroll/ScrollAnimator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 // Check setting for OS X < 10.8. 698 // Check setting for OS X < 10.8.
699 if (!value) 699 if (!value)
700 value = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleS crollAnimationEnabled"]; 700 value = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleS crollAnimationEnabled"];
701 if (value) 701 if (value)
702 enabled = [value boolValue]; 702 enabled = [value boolValue];
703 initialized = true; 703 initialized = true;
704 } 704 }
705 return enabled; 705 return enabled;
706 } 706 }
707 707
708 ScrollResultOneDimensional ScrollAnimatorMac::scroll(ScrollbarOrientation orient ation, ScrollGranularity granularity, float step, float delta) 708 ScrollResultOneDimensional ScrollAnimatorMac::userScroll(ScrollbarOrientation or ientation, ScrollGranularity granularity, float step, float delta)
709 { 709 {
710 m_haveScrolledSincePageLoad = true; 710 m_haveScrolledSincePageLoad = true;
711 711
712 if (!scrollAnimationEnabledForSystem() || !m_scrollableArea->scrollAnimatorE nabled()) 712 if (!scrollAnimationEnabledForSystem() || !m_scrollableArea->scrollAnimatorE nabled())
713 return ScrollAnimator::scroll(orientation, granularity, step, delta); 713 return ScrollAnimator::userScroll(orientation, granularity, step, delta) ;
714 714
715 if (granularity == ScrollByPixel || granularity == ScrollByPrecisePixel) 715 if (granularity == ScrollByPixel || granularity == ScrollByPrecisePixel)
716 return ScrollAnimator::scroll(orientation, granularity, step, delta); 716 return ScrollAnimator::userScroll(orientation, granularity, step, delta) ;
717 717
718 float currentPos = orientation == HorizontalScrollbar ? m_currentPosX : m_cu rrentPosY; 718 float currentPos = orientation == HorizontalScrollbar ? m_currentPosX : m_cu rrentPosY;
719 float newPos = std::max<float>(std::min<float>(currentPos + (step * delta), m_scrollableArea->maximumScrollPosition(orientation)), m_scrollableArea->minimum ScrollPosition(orientation)); 719 float newPos = std::max<float>(std::min<float>(currentPos + (step * delta), m_scrollableArea->maximumScrollPosition(orientation)), m_scrollableArea->minimum ScrollPosition(orientation));
720 if (currentPos == newPos) 720 if (currentPos == newPos)
721 return ScrollResultOneDimensional(false); 721 return ScrollResultOneDimensional(false);
722 722
723 NSPoint newPoint; 723 NSPoint newPoint;
724 if ([m_scrollAnimationHelper.get() _isAnimating]) { 724 if ([m_scrollAnimationHelper.get() _isAnimating]) {
725 NSPoint targetOrigin = [m_scrollAnimationHelper.get() targetOrigin]; 725 NSPoint targetOrigin = [m_scrollAnimationHelper.get() targetOrigin];
726 newPoint = orientation == HorizontalScrollbar ? NSMakePoint(newPos, targ etOrigin.y) : NSMakePoint(targetOrigin.x, newPos); 726 newPoint = orientation == HorizontalScrollbar ? NSMakePoint(newPos, targ etOrigin.y) : NSMakePoint(targetOrigin.x, newPos);
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 return; 1167 return;
1168 1168
1169 m_visibleScrollerThumbRect = rectInViewCoordinates; 1169 m_visibleScrollerThumbRect = rectInViewCoordinates;
1170 } 1170 }
1171 1171
1172 bool ScrollAnimatorMac::canUseCoordinatedScrollbar() { 1172 bool ScrollAnimatorMac::canUseCoordinatedScrollbar() {
1173 return ScrollbarThemeMacCommon::isOverlayAPIAvailable(); 1173 return ScrollbarThemeMacCommon::isOverlayAPIAvailable();
1174 } 1174 }
1175 1175
1176 } // namespace blink 1176 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/mac/ScrollAnimatorMac.h ('k') | Source/platform/scroll/ScrollAnimator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698