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

Unified Diff: Source/core/dom/ViewportArguments.h

Issue 14813025: Refactor viewport initialization logic out of WebViewImpl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix webkit_unit_tests Created 7 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
Index: Source/core/dom/ViewportArguments.h
diff --git a/Source/core/dom/ViewportArguments.h b/Source/core/dom/ViewportArguments.h
index e6c61e6293e29abb4bb2fae7af86c7d4973957c6..a311af64b54a5a350e3a332d1dc0dbef31ad5978 100644
--- a/Source/core/dom/ViewportArguments.h
+++ b/Source/core/dom/ViewportArguments.h
@@ -28,6 +28,7 @@
#ifndef ViewportArguments_h
#define ViewportArguments_h
+#include "core/page/PageScaleConstraints.h"
#include "core/platform/graphics/FloatSize.h"
#include <wtf/Forward.h>
@@ -43,17 +44,6 @@ enum ViewportErrorCode {
TargetDensityDpiUnsupported
};
-struct ViewportAttributes {
- FloatSize layoutSize;
-
- float initialScale;
- float minimumScale;
- float maximumScale;
-
- float userScalable;
- float orientation;
-};
-
struct ViewportArguments {
enum Type {
@@ -96,7 +86,7 @@ struct ViewportArguments {
}
// All arguments are in CSS units.
- ViewportAttributes resolve(const FloatSize& initialViewportSize, const FloatSize& deviceSize, int defaultWidth) const;
+ PageScaleConstraints resolve(const FloatSize& initialViewportSize, const FloatSize& deviceSize, int defaultWidth) const;
float width;
float minWidth;
@@ -133,18 +123,8 @@ struct ViewportArguments {
{
return !(*this == other);
}
-
- // FIXME: We're going to keep this constant around until all embedders
- // refactor their code to no longer need it.
- static const float deprecatedTargetDPI;
};
-ViewportAttributes computeViewportAttributes(ViewportArguments args, int desktopWidth, int deviceWidth, int deviceHeight, float devicePixelRatio, IntSize visibleViewport);
-
-void restrictMinimumScaleFactorToViewportSize(ViewportAttributes& result, IntSize visibleViewport, float devicePixelRatio);
-void restrictScaleFactorToInitialScaleIfNotUserScalable(ViewportAttributes& result);
-float computeMinimumScaleFactorForContentContained(const ViewportAttributes& result, const IntSize& viewportSize, const IntSize& contentSize);
-
void setViewportFeature(const String& keyString, const String& valueString, Document*, void* data);
void reportViewportWarning(Document*, ViewportErrorCode, const String& replacement1, const String& replacement2);

Powered by Google App Engine
This is Rietveld 408576698