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

Unified Diff: Source/web/PageScaleConstraintsSet.cpp

Issue 53053002: [Android WebView] Add a legacy quirk for 'user-scalable=no' case (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Moved min/max scale reset under the quirk condition, rebased Created 7 years, 1 month 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/PageScaleConstraintsSet.h ('k') | Source/web/WebSettingsImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/PageScaleConstraintsSet.cpp
diff --git a/Source/web/PageScaleConstraintsSet.cpp b/Source/web/PageScaleConstraintsSet.cpp
index d319e00d5e2abd1c55a21d9fd49a115894655665..19ec04f6ac08cdb2a99027f092f9b1d67b3efdc6 100644
--- a/Source/web/PageScaleConstraintsSet.cpp
+++ b/Source/web/PageScaleConstraintsSet.cpp
@@ -134,9 +134,9 @@ static float computeHeightByAspectRatio(float width, const FloatSize& deviceSize
return width * (deviceSize.height() / deviceSize.width());
}
-void PageScaleConstraintsSet::adjustForAndroidWebViewQuirks(const ViewportDescription& description, IntSize viewSize, int layoutFallbackWidth, float deviceScaleFactor, bool supportTargetDensityDPI, bool wideViewportQuirkEnabled, bool useWideViewport, bool loadWithOverviewMode)
+void PageScaleConstraintsSet::adjustForAndroidWebViewQuirks(const ViewportDescription& description, IntSize viewSize, int layoutFallbackWidth, float deviceScaleFactor, bool supportTargetDensityDPI, bool wideViewportQuirkEnabled, bool useWideViewport, bool loadWithOverviewMode, bool nonUserScalableQuirkEnabled)
{
- if (!supportTargetDensityDPI && !wideViewportQuirkEnabled && loadWithOverviewMode)
+ if (!supportTargetDensityDPI && !wideViewportQuirkEnabled && loadWithOverviewMode && !nonUserScalableQuirkEnabled)
return;
const float oldInitialScale = m_pageDefinedConstraints.initialScale;
@@ -184,6 +184,16 @@ void PageScaleConstraintsSet::adjustForAndroidWebViewQuirks(const ViewportDescri
}
}
+ if (nonUserScalableQuirkEnabled && !description.userZoom) {
+ m_pageDefinedConstraints.initialScale = targetDensityDPIFactor;
+ m_pageDefinedConstraints.minimumScale = m_pageDefinedConstraints.initialScale;
aelias_OOO_until_Jul13 2013/11/06 20:45:25 Hmm, I don't think this should've been moved here
+ m_pageDefinedConstraints.maximumScale = m_pageDefinedConstraints.initialScale;
+ if (description.maxWidth.isAuto() || description.maxWidth.type() == ExtendToZoom || description.maxWidth == Length(100, ViewportPercentageWidth)) {
+ adjustedLayoutSizeWidth = viewSize.width() / targetDensityDPIFactor;
+ adjustedLayoutSizeHeight = computeHeightByAspectRatio(adjustedLayoutSizeWidth, viewSize);
+ }
+ }
+
m_pageDefinedConstraints.layoutSize.setWidth(adjustedLayoutSizeWidth);
m_pageDefinedConstraints.layoutSize.setHeight(adjustedLayoutSizeHeight);
}
« no previous file with comments | « Source/web/PageScaleConstraintsSet.h ('k') | Source/web/WebSettingsImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698