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

Unified Diff: content/browser/webui/url_data_manager_backend.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: Implement as data source instead. Also rebased across thousands of CLs. 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/webui/url_data_manager_backend.cc
diff --git a/content/browser/webui/url_data_manager_backend.cc b/content/browser/webui/url_data_manager_backend.cc
index 128e02375be34ef591ce7b6277338e08298f5619..c1f22b5963852e62f09672b10bbc634fb5d25ccb 100644
--- a/content/browser/webui/url_data_manager_backend.cc
+++ b/content/browser/webui/url_data_manager_backend.cc
@@ -67,6 +67,7 @@ void URLToRequest(const GURL& url, std::string* source_name,
std::vector<std::string> additional_schemes;
DCHECK(url.SchemeIs(chrome::kChromeDevToolsScheme) ||
url.SchemeIs(chrome::kChromeUIScheme) ||
+ url.SchemeIs(chrome::kDomDistillerScheme) ||
(GetContentClient()->browser()->GetAdditionalWebUISchemes(
&additional_schemes),
SchemeIsInSchemes(url.scheme(), additional_schemes)));
@@ -76,10 +77,16 @@ void URLToRequest(const GURL& url, std::string* source_name,
return;
}
- // Our input looks like: chrome://source_name/extra_bits?foo .
- // So the url's "host" is our source, and everything after the host is
- // the path.
- source_name->assign(url.host());
+ if (url.SchemeIs(chrome::kDomDistillerScheme)) {
+ // Our input looks like: chrome-distiller://some-entry , so the scheme of
+ // the URL is the source name.
+ source_name->assign(chrome::kDomDistillerScheme);
+ } else {
+ // Our input looks like: chrome://source_name/extra_bits?foo .
+ // So the url's "host" is our source, and everything after the host is
+ // the path.
+ source_name->assign(url.host());
+ }
const std::string& spec = url.possibly_invalid_spec();
const url_parse::Parsed& parsed = url.parsed_for_possibly_invalid_spec();

Powered by Google App Engine
This is Rietveld 408576698