Chromium Code Reviews

Issue 2915: Add a new switch: --allow-scripts-to-close-windows.... (Closed)

Created:
12 years, 3 months ago by Patrick Johnson
Modified:
9 years, 7 months ago
Reviewers:
Feng Qian
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Add a new switch: --allow-scripts-to-close-windows. With this switch, window.close() will always be enabled. Currently the switch is only available in test_shell. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=2333

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Unified diffs Side-by-side diffs Stats (+39 lines, -2 lines)
M webkit/glue/webpreferences.h View 2 chunks +3 lines, -1 line 0 comments
M webkit/glue/webview_impl.cc View 1 chunk +2 lines, -0 lines 0 comments
M webkit/pending/DOMWindow.cpp View 2 chunks +8 lines, -1 line 0 comments
M webkit/pending/Settings.h View 2 chunks +4 lines, -0 lines 0 comments
M webkit/pending/Settings.cpp View 2 chunks +6 lines, -0 lines 0 comments
M webkit/tools/test_shell/test_shell.h View 1 chunk +2 lines, -0 lines 0 comments
M webkit/tools/test_shell/test_shell.cc View 2 chunks +7 lines, -0 lines 0 comments
M webkit/tools/test_shell/test_shell_main.cc View 1 chunk +3 lines, -0 lines 0 comments
M webkit/tools/test_shell/test_shell_switches.h View 1 chunk +1 line, -0 lines 0 comments
M webkit/tools/test_shell/test_shell_switches.cc View 1 chunk +3 lines, -0 lines 0 comments

Messages

Total messages: 3 (0 generated)
Patrick Johnson
12 years, 3 months ago (2008-09-16 22:52:54 UTC) #1
Feng Qian
See my comments. My concern is the change to Frame.h & Frame.cpp. Can we avoid ...
12 years, 3 months ago (2008-09-17 02:45:27 UTC) #2
Patrick Johnson
12 years, 3 months ago (2008-09-17 03:28:55 UTC) #3
http://codereview.chromium.org/2915/diff/14/217
File webkit/pending/DOMWindow.cpp (right):

http://codereview.chromium.org/2915/diff/14/217#newcode348
Line 348: if (m_frame->loader()->openedByDOM() ||
m_frame->loader()->getHistoryLength() <= 1 ||
m_frame->allowScriptsToCloseWindows())
On 2008/09/17 02:45:27, Feng Qian wrote:
> You may want to break this line into three lines.

Done.  I tried to follow WebKit style.

http://codereview.chromium.org/2915/diff/14/214
File webkit/pending/Frame.cpp (right):

http://codereview.chromium.org/2915/diff/14/214#newcode1197
Line 1197: return s ? s->allowScriptsToCloseWindows() : false;
On 2008/09/17 02:45:27, Feng Qian wrote:
> Can we move the logic into the caller so we can avoid making more changes in
> Frame.*? My understanding is that we try to folk less files.

Okay, I moved the logic out of Frame.cpp.  No more changes in Frame.*.

http://codereview.chromium.org/2915/diff/14/224
File webkit/tools/test_shell/test_shell_switches.cc (right):

http://codereview.chromium.org/2915/diff/14/224#newcode58
Line 58: const wchar_t kAllowScriptsToCloseWindows[] =
L"allow-scripts-to-close-windows";
On 2008/09/17 02:45:27, Feng Qian wrote:
> allow-scripts-to-close-window sounds too long, can you make a short version?

I picked that name to match dom.allow_scripts_to_close_windows in Firefox.  It
is long and IMO it's a good name but not perfect.

Something shorter could be: allow-script-close, but this might be confusing.

Powered by Google App Engine