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

Unified Diff: third_party/WebKit/Source/core/frame/FrameHost.cpp

Issue 2722773002: Moved FrameHost::setDefaultPageScaleLimits/UserAgentPageScaleConstraints (Closed)
Patch Set: Rebase Created 3 years, 10 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 | « no previous file | third_party/WebKit/Source/core/page/Page.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/FrameHost.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameHost.cpp b/third_party/WebKit/Source/core/frame/FrameHost.cpp
index a1047400c6b6df086413bcf5c756ad0db4d29204..b9b1ea2d08b3f812432803d330eecbfc64fa06c6 100644
--- a/third_party/WebKit/Source/core/frame/FrameHost.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameHost.cpp
@@ -34,7 +34,6 @@
#include "core/frame/EventHandlerRegistry.h"
#include "core/frame/FrameView.h"
#include "core/frame/PageScaleConstraints.h"
-#include "core/frame/PageScaleConstraintsSet.h"
#include "core/frame/VisualViewport.h"
#include "core/inspector/ConsoleMessageStorage.h"
#include "core/page/Page.h"
@@ -156,45 +155,12 @@ int FrameHost::subframeCount() const {
}
void FrameHost::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 (!page().mainFrame() || !page().mainFrame()->isLocalFrame())
- return;
-
- FrameView* rootView = page().deprecatedLocalMainFrame()->view();
-
- if (!rootView)
- return;
-
- rootView->setNeedsLayout();
+ page().setDefaultPageScaleLimits(minScale, maxScale);
}
void FrameHost::setUserAgentPageScaleConstraints(
const PageScaleConstraints& newConstraints) {
- if (newConstraints == pageScaleConstraintsSet().userAgentConstraints())
- return;
-
- pageScaleConstraintsSet().setUserAgentConstraints(newConstraints);
-
- if (!page().mainFrame() || !page().mainFrame()->isLocalFrame())
- return;
-
- FrameView* rootView = page().deprecatedLocalMainFrame()->view();
-
- if (!rootView)
- return;
-
- rootView->setNeedsLayout();
+ page().setUserAgentPageScaleConstraints(newConstraints);
}
} // namespace blink
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/page/Page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698