summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordglazkov@chromium.org <dglazkov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-25 21:10:50 +0000
committerdglazkov@chromium.org <dglazkov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-25 21:10:50 +0000
commit5bf6c79bec23db627ae9247488a3eb4b0f7af8fb (patch)
tree49cd51ce6ed84c16f714249e8569d2b277d32aa6
parent93339ae7a4d4a723efdfab56cc49c1ab77c4a7a1 (diff)
downloadchromium_src-5bf6c79bec23db627ae9247488a3eb4b0f7af8fb.zip
chromium_src-5bf6c79bec23db627ae9247488a3eb4b0f7af8fb.tar.gz
chromium_src-5bf6c79bec23db627ae9247488a3eb4b0f7af8fb.tar.bz2
Merge 33107 - Plumb through sitespecific quirks setting with a command line switch.
Quirks are enabled by default. R=darin BUG=19586 TEST=wikileaks.org should now have its sidebar in the proper place. Review URL: http://codereview.chromium.org/442010 TBR=dglazkov@chromium.org Review URL: http://codereview.chromium.org/442015 git-svn-id: svn://svn.chromium.org/chrome/branches/249/src@33114 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/tab_contents/render_view_host_delegate_helper.cc2
-rw-r--r--chrome/common/chrome_switches.cc3
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/common/render_messages.h2
-rw-r--r--webkit/glue/webpreferences.cc1
-rw-r--r--webkit/glue/webpreferences.h2
-rw-r--r--webkit/tools/test_shell/test_shell.cc1
7 files changed, 12 insertions, 0 deletions
diff --git a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
index fe7a2d2..85585a7 100644
--- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
+++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
@@ -185,6 +185,8 @@ WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs(
!command_line.HasSwitch(switches::kDisableDatabases);
web_prefs.experimental_webgl_enabled =
command_line.HasSwitch(switches::kEnableExperimentalWebGL);
+ web_prefs.site_specific_quirks_enabled =
+ !command_line.HasSwitch(switches::kDisableSiteSpecificQuirks);
}
web_prefs.uses_universal_detector =
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index f64e557..9e43fa3 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -129,6 +129,9 @@ const char kDisablePromptOnRepost[] = "disable-prompt-on-repost";
// Enable shared workers. Functionality not yet complete.
const char kDisableSharedWorkers[] = "disable-shared-workers";
+// Disable site-specific tailoring to compatibility issues in WebKit.
+const char kDisableSiteSpecificQuirks[] = "disable-site-specific-quirks";
+
// Disable syncing bookmarks to a Google Account.
const char kDisableSync[] = "disable-sync";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index e58990d..d1a7087 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -52,6 +52,7 @@ extern const char kDisablePlugins[];
extern const char kDisablePopupBlocking[];
extern const char kDisablePromptOnRepost[];
extern const char kDisableSharedWorkers[];
+extern const char kDisableSiteSpecificQuirks[];
extern const char kDisableSync[];
extern const char kDisableWebResources[];
extern const char kDisableWebSecurity[];
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index c2410ce..8f5a6cc 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -1621,6 +1621,7 @@ struct ParamTraits<WebPreferences> {
WriteParam(m, p.dom_paste_enabled);
WriteParam(m, p.developer_extras_enabled);
WriteParam(m, p.inspector_settings);
+ WriteParam(m, p.site_specific_quirks_enabled);
WriteParam(m, p.shrinks_standalone_images_to_fit);
WriteParam(m, p.uses_universal_detector);
WriteParam(m, p.text_areas_are_resizable);
@@ -1659,6 +1660,7 @@ struct ParamTraits<WebPreferences> {
ReadParam(m, iter, &p->dom_paste_enabled) &&
ReadParam(m, iter, &p->developer_extras_enabled) &&
ReadParam(m, iter, &p->inspector_settings) &&
+ ReadParam(m, iter, &p->site_specific_quirks_enabled) &&
ReadParam(m, iter, &p->shrinks_standalone_images_to_fit) &&
ReadParam(m, iter, &p->uses_universal_detector) &&
ReadParam(m, iter, &p->text_areas_are_resizable) &&
diff --git a/webkit/glue/webpreferences.cc b/webkit/glue/webpreferences.cc
index 77cbcfd..9c5780e 100644
--- a/webkit/glue/webpreferences.cc
+++ b/webkit/glue/webpreferences.cc
@@ -40,6 +40,7 @@ void WebPreferences::Apply(WebView* web_view) const {
settings->setPluginsEnabled(plugins_enabled);
settings->setDOMPasteAllowed(dom_paste_enabled);
settings->setDeveloperExtrasEnabled(developer_extras_enabled);
+ settings->setNeedsSiteSpecificQuirks(site_specific_quirks_enabled);
settings->setShrinksStandaloneImagesToFit(shrinks_standalone_images_to_fit);
settings->setUsesEncodingDetector(uses_universal_detector);
settings->setTextAreasAreResizable(text_areas_are_resizable);
diff --git a/webkit/glue/webpreferences.h b/webkit/glue/webpreferences.h
index be54251..fc4775d 100644
--- a/webkit/glue/webpreferences.h
+++ b/webkit/glue/webpreferences.h
@@ -38,6 +38,7 @@ struct WebPreferences {
bool dom_paste_enabled;
bool developer_extras_enabled;
std::string inspector_settings;
+ bool site_specific_quirks_enabled;
bool shrinks_standalone_images_to_fit;
bool uses_universal_detector;
bool text_areas_are_resizable;
@@ -82,6 +83,7 @@ struct WebPreferences {
plugins_enabled(true),
dom_paste_enabled(false), // enables execCommand("paste")
developer_extras_enabled(false), // Requires extra work by embedder
+ site_specific_quirks_enabled(false),
shrinks_standalone_images_to_fit(true),
uses_universal_detector(false), // Disabled: page cycler regression
text_areas_are_resizable(true),
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc
index aeca423..6a2b4b6 100644
--- a/webkit/tools/test_shell/test_shell.cc
+++ b/webkit/tools/test_shell/test_shell.cc
@@ -414,6 +414,7 @@ void TestShell::ResetWebPreferences() {
web_prefs_->javascript_can_open_windows_automatically = true;
web_prefs_->dom_paste_enabled = true;
web_prefs_->developer_extras_enabled = !layout_test_mode_;
+ web_prefs_->site_specific_quirks_enabled = true;
web_prefs_->shrinks_standalone_images_to_fit = false;
web_prefs_->uses_universal_detector = false;
web_prefs_->text_areas_are_resizable = false;