summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-06 20:59:15 +0000
committerabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-06 20:59:15 +0000
commit58adf848df7ad7a724be0526e25196ba6adee0e9 (patch)
treebe019ccbc5b0778ab24423fc568b710d8e57cbaf /chrome
parent9b05174501e3d9da6da4a2473aa666c48366401b (diff)
downloadchromium_src-58adf848df7ad7a724be0526e25196ba6adee0e9.zip
chromium_src-58adf848df7ad7a724be0526e25196ba6adee0e9.tar.gz
chromium_src-58adf848df7ad7a724be0526e25196ba6adee0e9.tar.bz2
Add a command line option --disable-web-security. People can use this option when the same-origin policy interferes with testing their web sites.
R=deanm BUG=6449 Review URL: http://codereview.chromium.org/20101 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9337 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/tab_contents/web_contents.cc5
-rw-r--r--chrome/common/chrome_switches.cc3
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/common/pref_names.cc2
-rw-r--r--chrome/common/pref_names.h1
-rw-r--r--chrome/common/render_messages.h2
6 files changed, 14 insertions, 0 deletions
diff --git a/chrome/browser/tab_contents/web_contents.cc b/chrome/browser/tab_contents/web_contents.cc
index f0f39bf..ec55a6c 100644
--- a/chrome/browser/tab_contents/web_contents.cc
+++ b/chrome/browser/tab_contents/web_contents.cc
@@ -241,6 +241,8 @@ void WebContents::RegisterUserPrefs(PrefService* prefs) {
WebPreferences pref_defaults;
prefs->RegisterBooleanPref(prefs::kWebKitJavascriptEnabled,
pref_defaults.javascript_enabled);
+ prefs->RegisterBooleanPref(prefs::kWebKitWebSecurityEnabled,
+ pref_defaults.web_security_enabled);
prefs->RegisterBooleanPref(
prefs::kWebKitJavascriptCanOpenWindowsAutomatically, true);
prefs->RegisterBooleanPref(prefs::kWebKitLoadsImagesAutomatically,
@@ -1204,6 +1206,9 @@ WebPreferences WebContents::GetWebkitPrefs() {
web_prefs.javascript_enabled =
!command_line.HasSwitch(switches::kDisableJavaScript) &&
prefs->GetBoolean(prefs::kWebKitJavascriptEnabled);
+ web_prefs.web_security_enabled =
+ !command_line.HasSwitch(switches::kDisableWebSecurity) &&
+ prefs->GetBoolean(prefs::kWebKitWebSecurityEnabled);
web_prefs.plugins_enabled =
!command_line.HasSwitch(switches::kDisablePlugins) &&
prefs->GetBoolean(prefs::kWebKitPluginsEnabled);
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index c161449..00e7f11 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -299,6 +299,9 @@ const wchar_t kDisablePopupBlocking[] = L"disable-popup-blocking";
// Don't execute JavaScript (browser JS like the new tab page still runs).
const wchar_t kDisableJavaScript[] = L"disable-javascript";
+// Don't enforce the same-origin policy. (Used by people testing their sites.)
+const wchar_t kDisableWebSecurity[] = L"disable-web-security";
+
// Prevent Java from running.
const wchar_t kDisableJava[] = L"disable-java";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 38228f0..4305374 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -111,6 +111,7 @@ extern const wchar_t kDisableJavaScript[];
extern const wchar_t kDisableJava[];
extern const wchar_t kDisablePlugins[];
extern const wchar_t kDisableImages[];
+extern const wchar_t kDisableWebSecurity[];
extern const wchar_t kUseLowFragHeapCrt[];
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
index 2e55a6b..f00406d 100644
--- a/chrome/common/pref_names.cc
+++ b/chrome/common/pref_names.cc
@@ -102,6 +102,8 @@ const wchar_t kWebKitMinimumLogicalFontSize[] =
L"webkit.webprefs.minimum_logical_font_size";
const wchar_t kWebKitJavascriptEnabled[] =
L"webkit.webprefs.javascript_enabled";
+const wchar_t kWebKitWebSecurityEnabled[] =
+ L"webkit.webprefs.web_security_enabled";
const wchar_t kWebKitJavascriptCanOpenWindowsAutomatically[] =
L"webkit.webprefs.javascript_can_open_windows_automatically";
const wchar_t kWebKitLoadsImagesAutomatically[] =
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
index f0c514c..6e09d74 100644
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -36,6 +36,7 @@ extern const wchar_t kWebKitDefaultFixedFontSize[];
extern const wchar_t kWebKitMinimumFontSize[];
extern const wchar_t kWebKitMinimumLogicalFontSize[];
extern const wchar_t kWebKitJavascriptEnabled[];
+extern const wchar_t kWebKitWebSecurityEnabled[];
extern const wchar_t kWebKitJavascriptCanOpenWindowsAutomatically[];
extern const wchar_t kWebKitLoadsImagesAutomatically[];
extern const wchar_t kWebKitPluginsEnabled[];
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index b2ef967..689918e 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -1461,6 +1461,7 @@ struct ParamTraits<WebPreferences> {
WriteParam(m, p.minimum_logical_font_size);
WriteParam(m, p.default_encoding);
WriteParam(m, p.javascript_enabled);
+ WriteParam(m, p.web_security_enabled);
WriteParam(m, p.javascript_can_open_windows_automatically);
WriteParam(m, p.loads_images_automatically);
WriteParam(m, p.plugins_enabled);
@@ -1488,6 +1489,7 @@ struct ParamTraits<WebPreferences> {
ReadParam(m, iter, &p->minimum_logical_font_size) &&
ReadParam(m, iter, &p->default_encoding) &&
ReadParam(m, iter, &p->javascript_enabled) &&
+ ReadParam(m, iter, &p->web_security_enabled) &&
ReadParam(m, iter, &p->javascript_can_open_windows_automatically) &&
ReadParam(m, iter, &p->loads_images_automatically) &&
ReadParam(m, iter, &p->plugins_enabled) &&