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

Unified Diff: webkit/pending/DOMWindow.cpp

Issue 2915: Add a new switch: --allow-scripts-to-close-windows.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 3 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 | « webkit/glue/webview_impl.cc ('k') | webkit/pending/Settings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/pending/DOMWindow.cpp
===================================================================
--- webkit/pending/DOMWindow.cpp (revision 2301)
+++ webkit/pending/DOMWindow.cpp (working copy)
@@ -46,6 +46,7 @@
#include "PlatformScreen.h"
#include "PlatformString.h"
#include "Screen.h"
+#include "Settings.h"
#include <algorithm>
#include <wtf/MathExtras.h>
@@ -345,7 +346,13 @@
if (!m_frame)
return;
- if (m_frame->loader()->openedByDOM() || m_frame->loader()->getHistoryLength() <= 1)
+ Settings* settings = m_frame->settings();
+ bool allow_scripts_to_close_windows =
+ (settings && settings->allowScriptsToCloseWindows());
+
+ if (m_frame->loader()->openedByDOM()
+ || m_frame->loader()->getHistoryLength() <= 1
+ || allow_scripts_to_close_windows)
m_frame->scheduleClose();
}
« no previous file with comments | « webkit/glue/webview_impl.cc ('k') | webkit/pending/Settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698