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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 263853008: Added pinch viewport offset to history item. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | Source/web/tests/PinchViewportTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index 0c0d2f927333e80129105f1c977328f1861d012c..55494cdca2a6a30e5758cba61def88540d02cff0 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -367,7 +367,6 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
, m_zoomLevel(0)
, m_minimumZoomLevel(zoomFactorToZoomLevel(minTextSizeMultiplier))
, m_maximumZoomLevel(zoomFactorToZoomLevel(maxTextSizeMultiplier))
- , m_savedPageScaleFactor(0)
, m_doubleTapZoomPageScaleFactor(0)
, m_doubleTapZoomPending(false)
, m_enableFakePageScaleAnimationForTesting(false)
@@ -3048,30 +3047,13 @@ float WebViewImpl::maximumPageScaleFactor() const
return m_pageScaleConstraintsSet.finalConstraints().maximumScale;
}
-void WebViewImpl::saveScrollAndScaleState()
-{
- m_savedPageScaleFactor = pageScaleFactor();
- m_savedScrollOffset = mainFrame()->scrollOffset();
-}
-
-void WebViewImpl::restoreScrollAndScaleState()
-{
- if (!m_savedPageScaleFactor)
- return;
-
- startPageScaleAnimation(IntPoint(m_savedScrollOffset), false, m_savedPageScaleFactor, scrollAndScaleAnimationDurationInSeconds);
- resetSavedScrollAndScaleState();
-}
-
-void WebViewImpl::resetSavedScrollAndScaleState()
-{
- m_savedPageScaleFactor = 0;
- m_savedScrollOffset = IntSize();
-}
-
void WebViewImpl::resetScrollAndScaleState()
{
- setPageScaleFactor(1, IntPoint());
+ // TODO: This is done by the pinchViewport().reset() call below and can be removed when
+ // the new pinch path is the only one.
+ setPageScaleFactor(1);
+ updateMainFrameScrollPosition(IntPoint(), true);
+ page()->frameHost().pinchViewport().reset();
// Clear out the values for the current history item. This will prevent the history item from clobbering the
// value determined during page scale initialization, which may be less than 1.
@@ -3081,7 +3063,6 @@ void WebViewImpl::resetScrollAndScaleState()
// Clobber saved scales and scroll offsets.
if (FrameView* view = page()->mainFrame()->document()->view())
view->cacheCurrentScrollPosition();
- resetSavedScrollAndScaleState();
}
void WebViewImpl::setFixedLayoutSize(const WebSize& layoutSize)
@@ -3596,7 +3577,6 @@ void WebViewImpl::didCommitLoad(bool isNewNavigation, bool isNavigationWithinPag
// Make sure link highlight from previous page is cleared.
m_linkHighlights.clear();
endActiveFlingAnimation();
- resetSavedScrollAndScaleState();
m_userGestureObserved = false;
}
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | Source/web/tests/PinchViewportTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698