diff options
Diffstat (limited to 'content/browser/webui')
-rw-r--r-- | content/browser/webui/web_ui_data_source_impl.cc | 10 | ||||
-rw-r--r-- | content/browser/webui/web_ui_data_source_impl.h | 2 |
2 files changed, 11 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; } diff --git a/content/browser/webui/web_ui_data_source_impl.h b/content/browser/webui/web_ui_data_source_impl.h index 0b6f8a3..1f81004 100644 --- a/content/browser/webui/web_ui_data_source_impl.h +++ b/content/browser/webui/web_ui_data_source_impl.h @@ -42,6 +42,7 @@ class CONTENT_EXPORT WebUIDataSourceImpl virtual void SetDefaultResource(int resource_id) OVERRIDE; virtual void SetRequestFilter( const WebUIDataSource::HandleRequestCallback& callback) OVERRIDE; + virtual void DisableReplaceExistingSource() OVERRIDE; virtual void DisableContentSecurityPolicy() OVERRIDE; virtual void OverrideContentSecurityPolicyObjectSrc( const std::string& data) OVERRIDE; @@ -99,6 +100,7 @@ class CONTENT_EXPORT WebUIDataSourceImpl std::string frame_src_; bool deny_xframe_options_; bool disable_set_font_strings_; + bool replace_existing_source_; DISALLOW_COPY_AND_ASSIGN(WebUIDataSourceImpl); }; |