OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/webui/task_scheduler_internals/task_scheduler_intern
als_ui.h" |
| 6 |
| 7 #include "base/task_scheduler/task_scheduler.h" |
| 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/common/url_constants.h" |
| 10 #include "chrome/grit/task_scheduler_internals_resources.h" |
| 11 #include "content/public/browser/web_ui_data_source.h" |
| 12 |
| 13 TaskSchedulerInternalsUI::TaskSchedulerInternalsUI(content::WebUI* web_ui) |
| 14 : content::WebUIController(web_ui) { |
| 15 content::WebUIDataSource* html_source = |
| 16 content::WebUIDataSource::Create( |
| 17 chrome::kChromeUITaskSchedulerInternalsHost); |
| 18 |
| 19 html_source->AddString("status", base::TaskScheduler::GetInstance() |
| 20 ? "Instantiated" |
| 21 : "Not Instantiated"); |
| 22 |
| 23 html_source->SetDefaultResource( |
| 24 IDR_TASK_SCHEDULER_INTERNALS_RESOURCES_INDEX_HTML); |
| 25 |
| 26 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), html_source); |
| 27 } |
| 28 |
| 29 TaskSchedulerInternalsUI::~TaskSchedulerInternalsUI() = default; |
OLD | NEW |