X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2FWebKit%2FSource%2Fcore%2Fdom%2FViewportDescription.h;h=c5e22de890b781239df04b171b4db71ddb1a758a;hb=004985e17e624662a4c85c76a7654039dc83f028;hp=53eed2688f5ac3699e52e0cee31ce292d2609d8e;hpb=2f108dbacb161091e42a3479f4e171339b7e7623;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/WebKit/Source/core/dom/ViewportDescription.h b/src/third_party/WebKit/Source/core/dom/ViewportDescription.h index 53eed26..c5e22de 100644 --- a/src/third_party/WebKit/Source/core/dom/ViewportDescription.h +++ b/src/third_party/WebKit/Source/core/dom/ViewportDescription.h @@ -34,6 +34,9 @@ namespace WebCore { +class KURL; +class LocalFrame; + struct ViewportDescription { enum Type { @@ -63,14 +66,18 @@ struct ViewportDescription { , zoom(ValueAuto) , minZoom(ValueAuto) , maxZoom(ValueAuto) - , userZoom(ValueAuto) + , userZoom(true) , orientation(ValueAuto) , deprecatedTargetDensityDPI(ValueAuto) + , zoomIsExplicit(false) + , minZoomIsExplicit(false) + , maxZoomIsExplicit(false) + , userZoomIsExplicit(false) { } // All arguments are in CSS units. - PageScaleConstraints resolve(const FloatSize& initialViewportSize) const; + PageScaleConstraints resolve(const FloatSize& initialViewportSize, Length legacyFallbackWidth) const; Length minWidth; Length maxWidth; @@ -79,10 +86,17 @@ struct ViewportDescription { float zoom; float minZoom; float maxZoom; - float userZoom; + bool userZoom; float orientation; float deprecatedTargetDensityDPI; // Only used for Android WebView + // Whether the computed value was explicitly specified rather than being + // inferred. + bool zoomIsExplicit; + bool minZoomIsExplicit; + bool maxZoomIsExplicit; + bool userZoomIsExplicit; + bool operator==(const ViewportDescription& other) const { // Used for figuring out whether to reset the viewport or not, @@ -96,7 +110,11 @@ struct ViewportDescription { && maxZoom == other.maxZoom && userZoom == other.userZoom && orientation == other.orientation - && deprecatedTargetDensityDPI == other.deprecatedTargetDensityDPI; + && deprecatedTargetDensityDPI == other.deprecatedTargetDensityDPI + && zoomIsExplicit == other.zoomIsExplicit + && minZoomIsExplicit == other.minZoomIsExplicit + && maxZoomIsExplicit == other.maxZoomIsExplicit + && userZoomIsExplicit == other.userZoomIsExplicit; } bool operator!=(const ViewportDescription& other) const @@ -108,6 +126,10 @@ struct ViewportDescription { bool isMetaViewportType() const { return type == ViewportMeta; } bool isSpecifiedByAuthor() const { return type != UserAgentStyleSheet; } + // Reports UMA stat on whether the page is considered mobile or desktop and what kind of + // mobile it is. Applies only to Android, must only be called once per page load. + void reportMobilePageStats(const LocalFrame*) const; + private: enum Direction { Horizontal, Vertical }; static float resolveViewportLength(const Length&, const FloatSize& initialViewportSize, Direction);