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

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

Issue 225303014: [Pinch-to-zoom] Moved scale factor into PinchViewport (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed layout test breakage Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/page/Page.h ('k') | Source/platform/geometry/FloatPoint.h » ('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 8da4a2127f7cc412e59e4cf7beeb577c55b502c0..91a8c1df3d22f116714e83379c14a1ffc155ebee 100644
--- a/Source/core/page/Page.cpp
+++ b/Source/core/page/Page.cpp
@@ -127,7 +127,6 @@ Page::Page(PageClients& pageClients)
, m_openedByDOM(false)
, m_tabKeyCyclesThroughElements(true)
, m_defersLoading(false)
- , m_pageScaleFactor(1)
, m_deviceScaleFactor(1)
, m_timerAlignmentInterval(DOMTimer::visiblePageAlignmentInterval())
, m_visibilityState(PageVisibilityStateVisible)
@@ -318,9 +317,10 @@ void Page::setDefersLoading(bool defers)
void Page::setPageScaleFactor(float scale, const IntPoint& origin)
{
FrameView* view = mainFrame()->view();
+ PinchViewport& viewport = frameHost().pinchViewport();
- if (scale != m_pageScaleFactor) {
- m_pageScaleFactor = scale;
+ if (scale != viewport.scale()) {
+ viewport.setScale(scale);
if (view)
view->setVisibleContentScaleFactor(scale);
@@ -338,6 +338,11 @@ void Page::setPageScaleFactor(float scale, const IntPoint& origin)
view->notifyScrollPositionChanged(origin);
}
+float Page::pageScaleFactor() const
+{
+ return frameHost().pinchViewport().scale();
+}
+
void Page::setDeviceScaleFactor(float scaleFactor)
{
if (m_deviceScaleFactor == scaleFactor)
« no previous file with comments | « Source/core/page/Page.h ('k') | Source/platform/geometry/FloatPoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698