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

Unified Diff: Source/core/frame/LocalDOMWindow.cpp

Issue 1109213002: Make createWindow (mostly) work with OOPIF (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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/frame/LocalDOMWindow.cpp
diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp
index 622fac167ff109dfb637c2645f3662cccdca2c2d..c0598d35f551ce0f496fef38847d804f69a82b09 100644
--- a/Source/core/frame/LocalDOMWindow.cpp
+++ b/Source/core/frame/LocalDOMWindow.cpp
@@ -71,10 +71,6 @@
#include "platform/EventDispatchForbiddenScope.h"
#include "platform/PlatformScreen.h"
#include "public/platform/Platform.h"
-#include <algorithm>
-
-using std::min;
-using std::max;
namespace blink {
@@ -253,33 +249,6 @@ unsigned LocalDOMWindow::pendingUnloadEventListeners() const
return windowsWithUnloadEventListeners().count(const_cast<LocalDOMWindow*>(this));
}
-// This function:
-// 1) Constrains the window rect to the minimum window size and no bigger than the int rect's dimensions.
-// 2) Constrains the window rect to within the top and left boundaries of the available screen rect.
-// 3) Constrains the window rect to within the bottom and right boundaries of the available screen rect.
-// 4) Translate the window rect coordinates to be within the coordinate space of the screen.
-IntRect LocalDOMWindow::adjustWindowRect(LocalFrame& frame, const IntRect& pendingChanges)
Nate Chapin 2015/04/28 23:25:51 This was only ever called immediately before calli
-{
- FrameHost* host = frame.host();
- ASSERT(host);
-
- IntRect screen = screenAvailableRect(frame.view());
- IntRect window = pendingChanges;
-
- IntSize minimumSize = host->chrome().client().minimumWindowSize();
- // Let size 0 pass through, since that indicates default size, not minimum size.
- if (window.width())
- window.setWidth(min(max(minimumSize.width(), window.width()), screen.width()));
- if (window.height())
- window.setHeight(min(max(minimumSize.height(), window.height()), screen.height()));
-
- // Constrain the window position within the valid screen area.
- window.setX(max(screen.x(), min(window.x(), screen.maxX() - window.width())));
- window.setY(max(screen.y(), min(window.y(), screen.maxY() - window.height())));
-
- return window;
-}
-
bool LocalDOMWindow::allowPopUp(LocalFrame& firstFrame)
{
if (UserGestureIndicator::processingUserGesture())
@@ -1279,7 +1248,7 @@ void LocalDOMWindow::moveBy(int x, int y, bool hasX, bool hasY) const
IntRect windowRect = host->chrome().windowRect();
windowRect.move(x, y);
// Security check (the spec talks about UniversalBrowserWrite to disable this check...)
- host->chrome().setWindowRect(adjustWindowRect(*frame(), windowRect));
+ host->chrome().setWindowRect(frame()->view(), windowRect);
}
void LocalDOMWindow::moveTo(int x, int y, bool hasX, bool hasY) const
@@ -1297,7 +1266,7 @@ void LocalDOMWindow::moveTo(int x, int y, bool hasX, bool hasY) const
IntRect windowRect = host->chrome().windowRect();
windowRect.setLocation(IntPoint(hasX ? x : windowRect.x(), hasY ? y : windowRect.y()));
// Security check (the spec talks about UniversalBrowserWrite to disable this check...)
- host->chrome().setWindowRect(adjustWindowRect(*frame(), windowRect));
+ host->chrome().setWindowRect(frame()->view(), windowRect);
}
void LocalDOMWindow::resizeBy(int x, int y, bool hasX, bool hasY) const
@@ -1315,7 +1284,7 @@ void LocalDOMWindow::resizeBy(int x, int y, bool hasX, bool hasY) const
IntRect fr = host->chrome().windowRect();
IntSize dest = fr.size() + IntSize(x, y);
IntRect update(fr.location(), dest);
- host->chrome().setWindowRect(adjustWindowRect(*frame(), update));
+ host->chrome().setWindowRect(frame()->view(), update);
}
void LocalDOMWindow::resizeTo(int width, int height, bool hasWidth, bool hasHeight) const
@@ -1333,7 +1302,7 @@ void LocalDOMWindow::resizeTo(int width, int height, bool hasWidth, bool hasHeig
IntRect fr = host->chrome().windowRect();
IntSize dest = IntSize(hasWidth ? width : fr.width(), hasHeight ? height : fr.height());
IntRect update(fr.location(), dest);
- host->chrome().setWindowRect(adjustWindowRect(*frame(), update));
+ host->chrome().setWindowRect(frame()->view(), update);
}
int LocalDOMWindow::requestAnimationFrame(FrameRequestCallback* callback)
@@ -1619,7 +1588,7 @@ PassRefPtrWillBeRawPtr<DOMWindow> LocalDOMWindow::open(const String& urlString,
}
WindowFeatures windowFeatures(windowFeaturesString);
- LocalFrame* result = createWindow(urlString, frameName, windowFeatures, *callingWindow, *firstFrame, *frame());
+ Frame* result = createWindow(urlString, frameName, windowFeatures, *callingWindow, *firstFrame, *frame());
return result ? result->domWindow() : nullptr;
}

Powered by Google App Engine
This is Rietveld 408576698