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

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

Issue 2629573004: Add a chrome://webapks page. (Closed)
Patch Set: Add a chrome://webapks page. Created 3 years, 10 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 | « chrome/browser/ui/webui/webapks_ui.h ('k') | chrome/chrome_paks.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/webapks_ui.cc
diff --git a/chrome/browser/ui/webui/webapks_ui.cc b/chrome/browser/ui/webui/webapks_ui.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d713293024cb3825915cec95aaafe95d797151f4
--- /dev/null
+++ b/chrome/browser/ui/webui/webapks_ui.cc
@@ -0,0 +1,43 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/webapks_ui.h"
+
+#include <string>
+#include <unordered_set>
+
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/webui/webapks_handler.h"
+#include "chrome/common/url_constants.h"
+#include "chrome/grit/webapks_ui_resources.h"
+#include "components/grit/components_resources.h"
+#include "content/public/browser/web_ui.h"
+#include "content/public/browser/web_ui_data_source.h"
+
+using content::WebUIDataSource;
+
+namespace {
+
+WebUIDataSource* CreateWebApksUIDataSource() {
+ WebUIDataSource* html_source =
+ WebUIDataSource::Create(chrome::kChromeUIWebApksHost);
+ html_source->SetJsonPath("strings.js");
+ html_source->AddResourcePath("webapks.js", IDR_WEBAPKS_UI_JS);
+ html_source->AddResourcePath("about_webapks.css", IDR_WEBAPKS_UI_CSS);
+ html_source->SetDefaultResource(IDR_WEBAPKS_UI_HTML);
+ html_source->UseGzip(std::unordered_set<std::string>());
+
+ return html_source;
+}
+
+} // anonymous namespace
+
+WebApksUI::WebApksUI(content::WebUI* web_ui)
+ : content::WebUIController(web_ui) {
+ Profile* profile = Profile::FromWebUI(web_ui);
+ web_ui->AddMessageHandler(base::MakeUnique<WebApksHandler>());
+ WebUIDataSource::Add(profile, CreateWebApksUIDataSource());
+}
+
+WebApksUI::~WebApksUI() {}
« no previous file with comments | « chrome/browser/ui/webui/webapks_ui.h ('k') | chrome/chrome_paks.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698