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

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

Issue 22150004: Add WebUIDataSourceImpl::DisableReplaceExistingSource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment improvement, don't mention chrome in content layer Created 7 years, 4 months 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 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;
}
« 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