summaryrefslogtreecommitdiffstats
path: root/content/browser/webui/web_ui_data_source_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser/webui/web_ui_data_source_impl.cc')
-rw-r--r--content/browser/webui/web_ui_data_source_impl.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/content/browser/webui/web_ui_data_source_impl.cc b/content/browser/webui/web_ui_data_source_impl.cc
index b564e57..63e08bc 100644
--- a/content/browser/webui/web_ui_data_source_impl.cc
+++ b/content/browser/webui/web_ui_data_source_impl.cc
@@ -49,6 +49,9 @@ class WebUIDataSourceImpl::InternalDataSource : public URLDataSource {
return parent_->StartDataRequest(path, render_process_id, render_view_id,
callback);
}
+ virtual bool ShouldReplaceExistingSource() const OVERRIDE {
+ return parent_->replace_existing_source_;
+ }
virtual bool ShouldAddContentSecurityPolicy() const OVERRIDE {
return parent_->add_csp_;
}
@@ -81,7 +84,8 @@ WebUIDataSourceImpl::WebUIDataSourceImpl(const std::string& source_name)
object_src_set_(false),
frame_src_set_(false),
deny_xframe_options_(true),
- disable_set_font_strings_(false) {
+ disable_set_font_strings_(false),
+ replace_existing_source_(true) {
}
WebUIDataSourceImpl::~WebUIDataSourceImpl() {
@@ -134,6 +138,10 @@ void WebUIDataSourceImpl::SetRequestFilter(
filter_callback_ = callback;
}
+void WebUIDataSourceImpl::DisableReplaceExistingSource() {
+ replace_existing_source_ = false;
+}
+
void WebUIDataSourceImpl::DisableContentSecurityPolicy() {
add_csp_ = false;
}