summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvangelis@chromium.org <vangelis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-19 19:56:28 +0000
committervangelis@chromium.org <vangelis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-19 19:56:28 +0000
commit590e4fa86732108cf77c7ce32c67c92c4515de12 (patch)
treef0855b4a043825c398b08992a202e4d1f5c74cca
parenta716ef33efc8000a9cbc90ba89e355a5c4cd8310 (diff)
downloadchromium_src-590e4fa86732108cf77c7ce32c67c92c4515de12.zip
chromium_src-590e4fa86732108cf77c7ce32c67c92c4515de12.tar.gz
chromium_src-590e4fa86732108cf77c7ce32c67c92c4515de12.tar.bz2
Adding command line flag (--show-composited-render-layers) to enable the showDebugBorders setting in WebKit which is
used for displaying a border around composited layers. BUG=35613 TEST=NONE Review URL: http://codereview.chromium.org/593099 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39483 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.cc4
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/common/render_messages.h4
-rw-r--r--webkit/glue/webpreferences.cc4
-rw-r--r--webkit/glue/webpreferences.h7
6 files changed, 17 insertions, 5 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 baae7b9..a69d1f1 100644
--- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
+++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
@@ -190,6 +190,8 @@ WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs(
command_line.HasSwitch(switches::kEnableGeolocation);
web_prefs.allow_file_access_from_file_urls =
command_line.HasSwitch(switches::kAllowFileAccessFromFiles);
+ web_prefs.show_composited_layer_borders =
+ command_line.HasSwitch(switches::kShowCompositedLayerBorders);
}
web_prefs.uses_universal_detector =
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 36002c7..2099d95 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -602,6 +602,10 @@ const char kSearchInOmniboxHint[] = "search-in-omnibox-hint";
// See kHideIcons.
const char kShowIcons[] = "show-icons";
+// Renders a border around composited Render Layers to help debug and study
+// layer compositing.
+const char kShowCompositedLayerBorders[] = "show-composited-layer-borders";
+
// Visibly render a border around paint rects in the web page to help debug
// and study painting behavior.
const char kShowPaintRects[] = "show-paint-rects";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 7fb39bb..0785a56 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -173,6 +173,7 @@ extern const char kRestoreLastSession[];
extern const char kSafePlugins[];
extern const char kSdchFilter[];
extern const char kSearchInOmniboxHint[];
+extern const char kShowCompositedLayerBorders[];
extern const char kShowIcons[];
extern const char kShowPaintRects[];
extern const char kSilentDumpOnDCHECK[];
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index 4db7dc8..d610dac 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -1782,6 +1782,7 @@ struct ParamTraits<WebPreferences> {
WriteParam(m, p.allow_file_access_from_file_urls);
WriteParam(m, p.experimental_webgl_enabled);
WriteParam(m, p.geolocation_enabled);
+ WriteParam(m, p.show_composited_layer_borders);
}
static bool Read(const Message* m, void** iter, param_type* p) {
return
@@ -1822,7 +1823,8 @@ struct ParamTraits<WebPreferences> {
ReadParam(m, iter, &p->allow_universal_access_from_file_urls) &&
ReadParam(m, iter, &p->allow_file_access_from_file_urls) &&
ReadParam(m, iter, &p->experimental_webgl_enabled) &&
- ReadParam(m, iter, &p->geolocation_enabled);
+ ReadParam(m, iter, &p->geolocation_enabled) &&
+ ReadParam(m, iter, &p->show_composited_layer_borders);
}
static void Log(const param_type& p, std::wstring* l) {
l->append(L"<WebPreferences>");
diff --git a/webkit/glue/webpreferences.cc b/webkit/glue/webpreferences.cc
index d14b600..c127ccd 100644
--- a/webkit/glue/webpreferences.cc
+++ b/webkit/glue/webpreferences.cc
@@ -89,6 +89,10 @@ void WebPreferences::Apply(WebView* web_view) const {
// compiled in.
settings->setGeolocationEnabled(geolocation_enabled);
+ // Display colored borders around composited render layers if requested
+ // on command line.
+ settings->setShowDebugBorders(show_composited_layer_borders);
+
// Web inspector settings need to be passed in differently.
web_view->setInspectorSettings(WebString::fromUTF8(inspector_settings));
diff --git a/webkit/glue/webpreferences.h b/webkit/glue/webpreferences.h
index daf0043..e4ce6792 100644
--- a/webkit/glue/webpreferences.h
+++ b/webkit/glue/webpreferences.h
@@ -56,13 +56,11 @@ struct WebPreferences {
// load the style sheet using a request without a frame.
bool user_style_sheet_enabled;
GURL user_style_sheet_location;
-
bool allow_universal_access_from_file_urls;
bool allow_file_access_from_file_urls;
-
bool experimental_webgl_enabled;
-
bool geolocation_enabled;
+ bool show_composited_layer_borders;
// We try to keep the default values the same as the default values in
// chrome, except for the cases where it would require lots of extra work for
@@ -103,7 +101,8 @@ struct WebPreferences {
allow_universal_access_from_file_urls(false),
allow_file_access_from_file_urls(false),
experimental_webgl_enabled(false),
- geolocation_enabled(false) {
+ geolocation_enabled(false),
+ show_composited_layer_borders(false) {
}
void Apply(WebKit::WebView* web_view) const;