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

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

Issue 2349623003: Add a Browser Task Scheduler Chrome Internals Page (Closed)
Patch Set: Created 4 years, 3 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/task_scheduler_internals_ui.cc
diff --git a/chrome/browser/ui/webui/task_scheduler_internals_ui.cc b/chrome/browser/ui/webui/task_scheduler_internals_ui.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ecfeb74f6a8830bdc0d0ad73c9af0fd2e11b0fad
--- /dev/null
+++ b/chrome/browser/ui/webui/task_scheduler_internals_ui.cc
@@ -0,0 +1,30 @@
+// 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/task_scheduler_internals_ui.h"
+
+#include "base/task_scheduler/task_scheduler.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/url_constants.h"
+#include "chrome/grit/task_scheduler_internals_resources.h"
+#include "content/public/browser/web_ui_data_source.h"
+
+TaskSchedulerInternalsUI::TaskSchedulerInternalsUI(content::WebUI* web_ui)
+ : content::WebUIController(web_ui) {
+ content::WebUIDataSource* html_source =
+ content::WebUIDataSource::Create(
+ chrome::kChromeUITaskSchedulerInternalsHost);
+
+ html_source->AddString("status", base::TaskScheduler::GetInstance()
+ ? "Initialized"
gab 2016/09/19 20:46:19 s/Initialized/Instantiated/ ?
robliao 2016/09/21 00:31:54 Sure, works for me. Done.
+ : "Not Initialized");
+ html_source->SetJsonPath("strings.js");
+
+ html_source->SetDefaultResource(
+ IDR_TASK_SCHEDULER_INTERNALS_RESOURCES_INDEX_HTML);
+
+ content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), html_source);
+}
+
+TaskSchedulerInternalsUI::~TaskSchedulerInternalsUI() = default;

Powered by Google App Engine
This is Rietveld 408576698