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

Unified Diff: content/browser/browser_url_handler_impl.cc

Issue 105723002: Add the scheme chrome-distiller:// and hook up data source. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed const for mac build Created 6 years, 11 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
Index: content/browser/browser_url_handler_impl.cc
diff --git a/content/browser/browser_url_handler_impl.cc b/content/browser/browser_url_handler_impl.cc
index fb657c0547b9c87e969cb4293e07878d6bbc6afd..0832cae0013da51f7c21c7798fdba9d8ad653cdf 100644
--- a/content/browser/browser_url_handler_impl.cc
+++ b/content/browser/browser_url_handler_impl.cc
@@ -37,6 +37,24 @@ static bool HandleViewSource(GURL* url, BrowserContext* browser_context) {
}
}
+ // If none of the default allowed schemes match, try with additional schemes
+ // from the ContentClient.
+ if (!is_sub_scheme_allowed) {
+ std::vector<std::string> additional_schemes;
+ GetContentClient()->browser()->GetAdditionalSchemesForViewSource(
+ &additional_schemes);
+ for (std::vector<std::string>::const_iterator it =
bengr 2014/01/24 17:10:40 for (size_t i = 0; i < additional_schemes.size();
+ additional_schemes.begin();
+ it != additional_schemes.end();
+ ++it) {
+ std::string scheme = *it;
+ if (url->SchemeIs(scheme.c_str())) {
+ is_sub_scheme_allowed = true;
+ break;
+ }
+ }
+ }
+
if (!is_sub_scheme_allowed) {
*url = GURL(kAboutBlankURL);
return false;
« no previous file with comments | « components/dom_distiller/webui/dom_distiller_handler.cc ('k') | content/browser/webui/url_data_manager_backend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698