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

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

Issue 1176843006: Move window.close implementation to DOMWindow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove resetting of the main view. Created 5 years, 6 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 | « Source/core/frame/LocalDOMWindow.h ('k') | Source/core/frame/LocalFrame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/LocalDOMWindow.cpp
diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp
index bda2274a383094593f2a3d64ac36db2487398b56..698e2607fd6b9df9920658d7681c361a5f8241cc 100644
--- a/Source/core/frame/LocalDOMWindow.cpp
+++ b/Source/core/frame/LocalDOMWindow.cpp
@@ -757,46 +757,6 @@ void LocalDOMWindow::blur()
{
}
-void LocalDOMWindow::close(ExecutionContext* context)
-{
- if (!frame() || !frame()->isMainFrame())
- return;
-
- Page* page = frame()->page();
- if (!page)
- return;
-
- if (context) {
- ASSERT(isMainThread());
- Document* activeDocument = toDocument(context);
- if (!activeDocument)
- return;
-
- if (!activeDocument->frame() || !activeDocument->frame()->canNavigate(*frame()))
- return;
- }
-
- Settings* settings = frame()->settings();
- bool allowScriptsToCloseWindows = settings && settings->allowScriptsToCloseWindows();
-
- if (!page->openedByDOM() && frame()->loader().client()->backForwardLength() > 1 && !allowScriptsToCloseWindows) {
- frameConsole()->addMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, "Scripts may close only the windows that were opened by it."));
- return;
- }
-
- if (!frame()->loader().shouldClose())
- return;
-
- InspectorInstrumentation::willCloseWindow(context);
-
- page->chromeClient().closeWindowSoon();
- // So as to make window.closed return the expected result
- // after window.close(), separately record the to-be-closed
- // state of this window. Scripts may access window.closed
- // before the deferred close operation has gone ahead.
- m_windowIsClosing = true;
-}
-
void LocalDOMWindow::print()
{
if (!frame())
« no previous file with comments | « Source/core/frame/LocalDOMWindow.h ('k') | Source/core/frame/LocalFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698