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 b564e57599b84d3290207ee5a4dfd3cd38be8495..63e08bcf0baf73d5c1706ba9ad4ec892990548da 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; |
} |