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

Side by Side Diff: Source/WebCore/platform/ScrollAnimator.cpp

Issue 13905007: Remove the last remaining PLATFORM() bits from WebCore. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fffffffffff Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « Source/WebCore/platform/ScrollAnimator.h ('k') | Source/WebCore/platform/Scrollbar.cpp » ('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, Google Inc. All rights reserved. 2 * Copyright (c) 2010, Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 Scrollbar* horizontalScrollbar = m_scrollableArea->horizontalScrollbar(); 79 Scrollbar* horizontalScrollbar = m_scrollableArea->horizontalScrollbar();
80 Scrollbar* verticalScrollbar = m_scrollableArea->verticalScrollbar(); 80 Scrollbar* verticalScrollbar = m_scrollableArea->verticalScrollbar();
81 81
82 // Accept the event if we have a scrollbar in that direction and can still 82 // Accept the event if we have a scrollbar in that direction and can still
83 // scroll any further. 83 // scroll any further.
84 float deltaX = horizontalScrollbar ? e.deltaX() : 0; 84 float deltaX = horizontalScrollbar ? e.deltaX() : 0;
85 float deltaY = verticalScrollbar ? e.deltaY() : 0; 85 float deltaY = verticalScrollbar ? e.deltaY() : 0;
86 86
87 bool handled = false; 87 bool handled = false;
88 88
89 #if PLATFORM(CHROMIUM) && !OS(DARWIN) 89 #if !OS(DARWIN)
90 ScrollGranularity granularity = e.hasPreciseScrollingDeltas() ? ScrollByPrec isePixel : ScrollByPixel; 90 ScrollGranularity granularity = e.hasPreciseScrollingDeltas() ? ScrollByPrec isePixel : ScrollByPixel;
91 #else 91 #else
92 ScrollGranularity granularity = ScrollByPixel; 92 ScrollGranularity granularity = ScrollByPixel;
93 #endif 93 #endif
94 94
95 IntSize maxForwardScrollDelta = m_scrollableArea->maximumScrollPosition() - m_scrollableArea->scrollPosition(); 95 IntSize maxForwardScrollDelta = m_scrollableArea->maximumScrollPosition() - m_scrollableArea->scrollPosition();
96 IntSize maxBackwardScrollDelta = m_scrollableArea->scrollPosition() - m_scro llableArea->minimumScrollPosition(); 96 IntSize maxBackwardScrollDelta = m_scrollableArea->scrollPosition() - m_scro llableArea->minimumScrollPosition();
97 if ((deltaX < 0 && maxForwardScrollDelta.width() > 0) 97 if ((deltaX < 0 && maxForwardScrollDelta.width() > 0)
98 || (deltaX > 0 && maxBackwardScrollDelta.width() > 0) 98 || (deltaX > 0 && maxBackwardScrollDelta.width() > 0)
99 || (deltaY < 0 && maxForwardScrollDelta.height() > 0) 99 || (deltaY < 0 && maxForwardScrollDelta.height() > 0)
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 return FloatPoint(m_currentPosX, m_currentPosY); 134 return FloatPoint(m_currentPosX, m_currentPosY);
135 } 135 }
136 136
137 void ScrollAnimator::notifyPositionChanged(const FloatSize& delta) 137 void ScrollAnimator::notifyPositionChanged(const FloatSize& delta)
138 { 138 {
139 UNUSED_PARAM(delta); 139 UNUSED_PARAM(delta);
140 m_scrollableArea->setScrollOffsetFromAnimation(IntPoint(m_currentPosX, m_cur rentPosY)); 140 m_scrollableArea->setScrollOffsetFromAnimation(IntPoint(m_currentPosX, m_cur rentPosY));
141 } 141 }
142 142
143 } // namespace WebCore 143 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/platform/ScrollAnimator.h ('k') | Source/WebCore/platform/Scrollbar.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698