From 323088387fdb3d3debe60c0280b99cdc18803819 Mon Sep 17 00:00:00 2001 From: "tsepez@chromium.org" Date: Tue, 19 Jul 2011 17:41:11 +0000 Subject: Consolidate content-security-policy markup for chrome:// pages into a single file, and have grit preprocess it into all the places it belongs. Also add to resource bundle so that the about handler can return the same thing. Review URL: http://codereview.chromium.org/7396026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93052 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/browser_about_handler.cc | 8 +++----- chrome/browser/browser_resources.grd | 1 + chrome/browser/resources/about_conflicts.html | 4 +--- chrome/browser/resources/about_flash.html | 9 +-------- chrome/browser/resources/about_memory.html | 8 ++------ chrome/browser/resources/about_memory_linux.html | 7 +------ chrome/browser/resources/about_memory_mac.html | 8 ++------ chrome/browser/resources/about_stats.html | 10 +--------- chrome/browser/resources/about_version.html | 7 +------ chrome/browser/resources/content_security_policy.html | 18 ++++++++++++++++++ chrome/browser/resources/crashes.html | 6 +----- chrome/browser/resources/downloads.html | 10 +--------- chrome/browser/resources/extensions_ui.html | 6 +----- chrome/browser/resources/flags.html | 10 +--------- chrome/browser/resources/history.html | 10 +--------- chrome/browser/resources/options/options.html | 10 +--------- chrome/browser/resources/plugins.html | 10 +--------- 17 files changed, 38 insertions(+), 104 deletions(-) create mode 100644 chrome/browser/resources/content_security_policy.html (limited to 'chrome') diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc index 6ee0a36..8b6f8ae 100644 --- a/chrome/browser/browser_about_handler.cc +++ b/chrome/browser/browser_about_handler.cc @@ -408,11 +408,9 @@ void AppendHeader(std::string* output, int refresh, output->append(EscapeForHTML(unescaped_title)); output->append("\n"); } - output->append( - "\n\n"); + output->append("\n"); + output->append(ResourceBundle::GetSharedInstance().GetRawDataResource( + IDR_CONTENT_SECURITY_POLICY_HTML).as_string()); if (refresh > 0) { output->append("append(base::IntToString(refresh)); diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd index 0590e0f..49c0382 100644 --- a/chrome/browser/browser_resources.grd +++ b/chrome/browser/browser_resources.grd @@ -35,6 +35,7 @@ + diff --git a/chrome/browser/resources/about_conflicts.html b/chrome/browser/resources/about_conflicts.html index 6ac20b1..c0bb551 100644 --- a/chrome/browser/resources/about_conflicts.html +++ b/chrome/browser/resources/about_conflicts.html @@ -2,9 +2,7 @@ - +