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

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

Issue 1883523002: chrome://snippets-internals page for debugging NTP snippets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implementing last suggestions from Bernhard Created 4 years, 8 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/snippets_internals_ui.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/snippets_internals_ui.cc
diff --git a/chrome/browser/ui/webui/snippets_internals_ui.cc b/chrome/browser/ui/webui/snippets_internals_ui.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5c697a67d5ab675c804fa24fecf7ac1220e600a3
--- /dev/null
+++ b/chrome/browser/ui/webui/snippets_internals_ui.cc
@@ -0,0 +1,36 @@
+// Copyright 2016 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/snippets_internals_ui.h"
+
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/webui/snippets_internals_message_handler.h"
+#include "chrome/common/url_constants.h"
+#include "content/public/browser/web_ui.h"
+#include "content/public/browser/web_ui_data_source.h"
+#include "grit/browser_resources.h"
+
+namespace {
+
+content::WebUIDataSource* CreateSnippetsInternalsHTMLSource() {
+ content::WebUIDataSource* source =
+ content::WebUIDataSource::Create(chrome::kChromeUISnippetsInternalsHost);
+
+ source->AddResourcePath("snippets_internals.js", IDR_SNIPPETS_INTERNALS_JS);
+ source->AddResourcePath("snippets_internals.css", IDR_SNIPPETS_INTERNALS_CSS);
+ source->SetDefaultResource(IDR_SNIPPETS_INTERNALS_HTML);
+ return source;
+}
+
+} // namespace
+
+SnippetsInternalsUI::SnippetsInternalsUI(content::WebUI* web_ui)
+ : WebUIController(web_ui) {
+ Profile* profile = Profile::FromWebUI(web_ui);
+ content::WebUIDataSource::Add(profile, CreateSnippetsInternalsHTMLSource());
+
+ web_ui->AddMessageHandler(new SnippetsInternalsMessageHandler);
+}
+
+SnippetsInternalsUI::~SnippetsInternalsUI() {}
« no previous file with comments | « chrome/browser/ui/webui/snippets_internals_ui.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698