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

Unified Diff: Source/core/page/Page.cpp

Issue 1277583003: Restore scale even if scroll is not restored (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use window.scroll{X,y} Created 5 years, 4 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/core/page/Page.h ('k') | Source/core/testing/Internals.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/Page.cpp
diff --git a/Source/core/page/Page.cpp b/Source/core/page/Page.cpp
index 1160e57532a3ad21f55dd5887df611611cadb4a2..4fa9433bc2846df182c56ee914d27dcc932c9053 100644
--- a/Source/core/page/Page.cpp
+++ b/Source/core/page/Page.cpp
@@ -304,25 +304,9 @@ void Page::setDefersLoading(bool defers)
}
}
-void Page::setPageScaleFactor(float scale, const IntPoint& origin)
+void Page::setPageScaleFactor(float scale)
{
- if (!mainFrame()->isLocalFrame())
- return;
-
- FrameView* view = deprecatedLocalMainFrame()->view();
- ScrollableArea* layoutViewport = view ? view->layoutViewportScrollableArea() : nullptr;
- VisualViewport& visualViewport = frameHost().visualViewport();
-
- if (scale != visualViewport.scale()) {
- visualViewport.setScale(scale);
-
- chromeClient().pageScaleFactorChanged();
-
- deprecatedLocalMainFrame()->loader().saveScrollState();
- }
-
- if (layoutViewport && layoutViewport->scrollPosition() != origin)
- layoutViewport->setScrollPosition(origin, ProgrammaticScroll);
+ frameHost().visualViewport().setScale(scale);
}
float Page::pageScaleFactor() const
« no previous file with comments | « Source/core/page/Page.h ('k') | Source/core/testing/Internals.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698