Index: chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc |
diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc |
index fa712adbd24429c6a43ec7e183304f299b5209ac..f1c1de909e6bd65ac2533af3bedd487216cbe09f 100644 |
--- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc |
+++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc |
@@ -59,6 +59,7 @@ |
#include "components/dom_distiller/core/dom_distiller_constants.h" |
#include "components/dom_distiller/core/dom_distiller_service.h" |
#include "components/dom_distiller/webui/dom_distiller_ui.h" |
+#include "components/dom_distiller/webui/dom_distiller_viewer_ui.h" |
#include "content/public/browser/web_contents.h" |
#include "content/public/browser/web_ui.h" |
#include "content/public/common/content_client.h" |
@@ -200,8 +201,9 @@ WebUIController* NewWebUI<dom_distiller::DomDistillerUi>(WebUI* web_ui, |
dom_distiller::DomDistillerService* service = |
dom_distiller::DomDistillerServiceFactory::GetForBrowserContext( |
browser_context); |
- // TODO(nyquist): Add real scheme. |
- return new dom_distiller::DomDistillerUi(web_ui, service, "dummy"); |
+ return new dom_distiller::DomDistillerUi(web_ui, |
+ service, |
+ chrome::kDomDistillerScheme); |
} |
// Only create ExtensionWebUI for URLs that are allowed extension bindings, |
@@ -226,7 +228,8 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, |
// schemes to filter out most URLs. |
if (!url.SchemeIs(chrome::kChromeDevToolsScheme) && |
!url.SchemeIs(chrome::kChromeInternalScheme) && |
- !url.SchemeIs(chrome::kChromeUIScheme)) { |
+ !url.SchemeIs(chrome::kChromeUIScheme) && |
+ !url.SchemeIs(chrome::kDomDistillerScheme)) { |
return NULL; |
} |
@@ -493,9 +496,12 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, |
return &NewWebUI<PrintPreviewUI>; |
#endif |
- if (IsEnableDomDistillerSet() && |
- url.host() == dom_distiller::kChromeUIDomDistillerHost) { |
- return &NewWebUI<dom_distiller::DomDistillerUi>; |
+ if (IsEnableDomDistillerSet()) { |
+ if (url.SchemeIs(chrome::kDomDistillerScheme)) { |
+ return &NewWebUI<dom_distiller::DomDistillerViewerUi>; |
+ } else if (url.host() == dom_distiller::kChromeUIDomDistillerHost) { |
+ return &NewWebUI<dom_distiller::DomDistillerUi>; |
+ } |
} |
return NULL; |