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

Unified Diff: chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc

Issue 1138153002: Introduce chrome://cr-elements with Polymer .8 cr-elements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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: 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 fc43f0d61a8ed563fc228dff359009de716304e8..3ed10c353f1f352fe19d2cc65c3f361509cbe95e 100644
--- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
+++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
@@ -68,6 +68,7 @@
#include "content/public/browser/web_ui.h"
#include "content/public/common/content_client.h"
#include "content/public/common/url_utils.h"
+#include "grit/browser_resources.h"
#include "ui/gfx/favicon_size.h"
#include "ui/oobe/oobe_md_ui.h"
#include "ui/web_dialogs/web_dialog_ui.h"
@@ -212,6 +213,24 @@ WebUIController* NewWebUI<AboutUI>(WebUI* web_ui, const GURL& url) {
return new AboutUI(web_ui, url.host());
}
+class CrElementsUI : public content::WebUIController {
michaelpg 2015/05/14 03:05:11 This is weird. I'd prefer you create a new file.
+ public:
+ explicit CrElementsUI(content::WebUI* web_ui)
+ : content::WebUIController(web_ui) {
+ content::WebUIDataSource* html =
+ content::WebUIDataSource::Create(chrome::kChromeUICrElementsHost);
+ html->SetDefaultResource(IDR_CR_ELEMENTS_UI_HTML);
+ html->AddResourcePath("cr_elements_ui.js", IDR_CR_ELEMENTS_UI_JS);
+
+ content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(),
+ html);
+ }
+ ~CrElementsUI() override {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CrElementsUI);
+};
+
#if defined(OS_CHROMEOS)
template<>
WebUIController* NewWebUI<chromeos::OobeUI>(WebUI* web_ui, const GURL& url) {
@@ -312,6 +331,8 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
return &NewWebUI<ComponentsUI>;
if (url.spec() == chrome::kChromeUIConstrainedHTMLTestURL)
return &NewWebUI<ConstrainedWebDialogUI>;
+ if (url.host() == chrome::kChromeUICrElementsHost)
+ return &NewWebUI<CrElementsUI>;
if (url.host() == chrome::kChromeUICrashesHost)
return &NewWebUI<CrashesUI>;
if (url.host() == chrome::kChromeUIDeviceLogHost)

Powered by Google App Engine
This is Rietveld 408576698