Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(594)

Unified Diff: content/browser/webui/web_ui_data_source_impl.cc

Issue 2528903002: Allow the PDF extension for chrome://print pages. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/webui/web_ui_data_source_impl.h ('k') | content/public/browser/web_ui_data_source.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/webui/web_ui_data_source_impl.cc
diff --git a/content/browser/webui/web_ui_data_source_impl.cc b/content/browser/webui/web_ui_data_source_impl.cc
index a5364fbf2b2810e36be883d8a3bb4c7fc156ca31..2d6d24a916d5f43ec1a34d25881678357dd0c934 100644
--- a/content/browser/webui/web_ui_data_source_impl.cc
+++ b/content/browser/webui/web_ui_data_source_impl.cc
@@ -61,6 +61,11 @@ class WebUIDataSourceImpl::InternalDataSource : public URLDataSource {
bool ShouldAddContentSecurityPolicy() const override {
return parent_->add_csp_;
}
+ std::string GetContentSecurityPolicyScriptSrc() const override {
+ if (parent_->script_src_set_)
+ return parent_->script_src_;
+ return URLDataSource::GetContentSecurityPolicyScriptSrc();
+ }
std::string GetContentSecurityPolicyObjectSrc() const override {
if (parent_->object_src_set_)
return parent_->object_src_;
@@ -88,6 +93,7 @@ WebUIDataSourceImpl::WebUIDataSourceImpl(const std::string& source_name)
source_name_(source_name),
default_resource_(-1),
add_csp_(true),
+ script_src_set_(false),
object_src_set_(false),
frame_src_set_(false),
deny_xframe_options_(true),
@@ -180,6 +186,12 @@ void WebUIDataSourceImpl::DisableContentSecurityPolicy() {
add_csp_ = false;
}
+void WebUIDataSourceImpl::OverrideContentSecurityPolicyScriptSrc(
+ const std::string& data) {
+ script_src_set_ = true;
+ script_src_ = data;
+}
+
void WebUIDataSourceImpl::OverrideContentSecurityPolicyObjectSrc(
const std::string& data) {
object_src_set_ = true;
« no previous file with comments | « content/browser/webui/web_ui_data_source_impl.h ('k') | content/public/browser/web_ui_data_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698