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

Side by Side Diff: Source/platform/scroll/ScrollView.cpp

Issue 199253002: Made PinchViewport a ScrollableArea (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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/scroll/ScrollView.h ('k') | Source/platform/scroll/ScrollableArea.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) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 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 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 if (scrollOrigin() == origin) 1105 if (scrollOrigin() == origin)
1106 return; 1106 return;
1107 1107
1108 ScrollableArea::setScrollOrigin(origin); 1108 ScrollableArea::setScrollOrigin(origin);
1109 1109
1110 // Update if the scroll origin changes, since our position will be different if the content size did not change. 1110 // Update if the scroll origin changes, since our position will be different if the content size did not change.
1111 if (updatePositionAtAll && updatePositionSynchronously) 1111 if (updatePositionAtAll && updatePositionSynchronously)
1112 updateScrollbars(scrollOffset()); 1112 updateScrollbars(scrollOffset());
1113 } 1113 }
1114 1114
1115 int ScrollView::pageStep(ScrollbarOrientation orientation) const
1116 {
1117 int length = (orientation == HorizontalScrollbar) ? visibleWidth() : visible Height();
1118 int minPageStep = static_cast<float>(length) * minFractionToStepWhenPaging() ;
1119 int pageStep = std::max(minPageStep, length - maxOverlapBetweenPages());
1120
1121 return std::max(pageStep, 1);
1122 }
1123
1124 } // namespace WebCore 1115 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/platform/scroll/ScrollView.h ('k') | Source/platform/scroll/ScrollableArea.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698