| Index: third_party/WebKit/Source/core/page/Page.cpp
|
| diff --git a/third_party/WebKit/Source/core/page/Page.cpp b/third_party/WebKit/Source/core/page/Page.cpp
|
| index 1f6910aa91d0e0d0b915c6952fae75daacec222e..cb46ff7839871e4e42121a95f384be650f53f522 100644
|
| --- a/third_party/WebKit/Source/core/page/Page.cpp
|
| +++ b/third_party/WebKit/Source/core/page/Page.cpp
|
| @@ -34,6 +34,7 @@
|
| #include "core/frame/FrameConsole.h"
|
| #include "core/frame/FrameHost.h"
|
| #include "core/frame/FrameView.h"
|
| +#include "core/frame/PageScaleConstraints.h"
|
| #include "core/frame/PageScaleConstraintsSet.h"
|
| #include "core/frame/RemoteFrame.h"
|
| #include "core/frame/RemoteFrameView.h"
|
| @@ -256,6 +257,48 @@ void Page::setSuspended(bool suspended) {
|
| }
|
| }
|
|
|
| +void Page::setDefaultPageScaleLimits(float minScale, float maxScale) {
|
| + PageScaleConstraints newDefaults =
|
| + pageScaleConstraintsSet().defaultConstraints();
|
| + newDefaults.minimumScale = minScale;
|
| + newDefaults.maximumScale = maxScale;
|
| +
|
| + if (newDefaults == pageScaleConstraintsSet().defaultConstraints())
|
| + return;
|
| +
|
| + pageScaleConstraintsSet().setDefaultConstraints(newDefaults);
|
| + pageScaleConstraintsSet().computeFinalConstraints();
|
| + pageScaleConstraintsSet().setNeedsReset(true);
|
| +
|
| + if (!mainFrame() || !mainFrame()->isLocalFrame())
|
| + return;
|
| +
|
| + FrameView* rootView = deprecatedLocalMainFrame()->view();
|
| +
|
| + if (!rootView)
|
| + return;
|
| +
|
| + rootView->setNeedsLayout();
|
| +}
|
| +
|
| +void Page::setUserAgentPageScaleConstraints(
|
| + const PageScaleConstraints& newConstraints) {
|
| + if (newConstraints == pageScaleConstraintsSet().userAgentConstraints())
|
| + return;
|
| +
|
| + pageScaleConstraintsSet().setUserAgentConstraints(newConstraints);
|
| +
|
| + if (!mainFrame() || !mainFrame()->isLocalFrame())
|
| + return;
|
| +
|
| + FrameView* rootView = deprecatedLocalMainFrame()->view();
|
| +
|
| + if (!rootView)
|
| + return;
|
| +
|
| + rootView->setNeedsLayout();
|
| +}
|
| +
|
| void Page::setPageScaleFactor(float scale) {
|
| frameHost().visualViewport().setScale(scale);
|
| }
|
|
|