-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enterprise Reporting webUI boilerplate
This change create the boilerplate code for a webUI which will describe the health of enterprise reporting systems. Bug: b:214041435 Change-Id: I6b7b4d6b634c35471e3f590cf13d084dfd60de17 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3753554 Reviewed-by: Chad Duffin <chadduffin@chromium.org> Commit-Queue: Tyler Garrett <tylergarrett@chromium.org> Reviewed-by: Kyle Horimoto <khorimoto@chromium.org> Cr-Commit-Position: refs/heads/main@{#1101045}
- Loading branch information
Tyler Garrett
authored and
Chromium LUCI CQ
committed
Feb 3, 2023
1 parent
82b5ce9
commit a39d07a
Showing
13 changed files
with
118 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
chrome/browser/resources/chromeos/enterprise_reporting/BUILD.gn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2023 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. | ||
|
||
import("//chrome/browser/resources/tools/build_webui.gni") | ||
|
||
assert(is_chromeos_ash) | ||
|
||
build_webui("build") { | ||
grd_prefix = "enterprise_reporting" | ||
static_files = [ "enterprise_reporting.html" ] | ||
non_web_component_files = [ "enterprise_reporting.ts" ] | ||
|
||
ts_use_local_config = true | ||
ts_deps = [ "//ui/webui/resources/js:build_ts" ] | ||
} |
11 changes: 11 additions & 0 deletions
11
chrome/browser/resources/chromeos/enterprise_reporting/enterprise_reporting.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Enterprise Reporting</title> | ||
<script type="module" src="enterprise_reporting.js"></script> | ||
</head> | ||
<body> | ||
<h1>Enterprise Reporting</h1> | ||
</body> | ||
</html> |
7 changes: 7 additions & 0 deletions
7
chrome/browser/resources/chromeos/enterprise_reporting/enterprise_reporting.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
function initialize() {} | ||
|
||
document.addEventListener('DOMContentLoaded', initialize); |
6 changes: 6 additions & 0 deletions
6
chrome/browser/resources/chromeos/enterprise_reporting/tsconfig_base.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": "../../../../../tools/typescript/tsconfig_base.json", | ||
"compilerOptions": { | ||
"allowJs": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
chrome/browser/ui/webui/ash/enterprise_reporting/enterprise_reporting_ui.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// 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/ash/enterprise_reporting/enterprise_reporting_ui.h" | ||
|
||
#include "ash/constants/ash_features.h" | ||
#include "base/containers/span.h" | ||
#include "chrome/browser/ui/webui/webui_util.h" | ||
#include "chrome/common/webui_url_constants.h" | ||
#include "chrome/grit/enterprise_reporting_resources.h" | ||
#include "chrome/grit/enterprise_reporting_resources_map.h" | ||
#include "content/public/browser/browser_context.h" | ||
#include "content/public/browser/web_contents.h" | ||
#include "content/public/browser/web_ui.h" | ||
#include "content/public/browser/web_ui_data_source.h" | ||
|
||
namespace ash::reporting { | ||
|
||
EnterpriseReportingUI::EnterpriseReportingUI(content::WebUI* web_ui) | ||
: content::WebUIController(web_ui) { | ||
DCHECK(base::FeatureList::IsEnabled(ash::features::kEnterpriseReportingUI)); | ||
// Set up the chrome://enterprise-reporting source. | ||
content::WebUIDataSource* html_source = | ||
content::WebUIDataSource::CreateAndAdd( | ||
web_ui->GetWebContents()->GetBrowserContext(), | ||
chrome::kChromeUIEnterpriseReportingHost); | ||
|
||
// Add required resources. | ||
webui::SetupWebUIDataSource( | ||
html_source, | ||
base::make_span(kEnterpriseReportingResources, | ||
kEnterpriseReportingResourcesSize), | ||
IDR_ENTERPRISE_REPORTING_ENTERPRISE_REPORTING_HTML); | ||
} | ||
|
||
EnterpriseReportingUI::~EnterpriseReportingUI() = default; | ||
|
||
} // namespace ash::reporting |
21 changes: 21 additions & 0 deletions
21
chrome/browser/ui/webui/ash/enterprise_reporting/enterprise_reporting_ui.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CHROME_BROWSER_UI_WEBUI_ASH_ENTERPRISE_REPORTING_ENTERPRISE_REPORTING_UI_H_ | ||
#define CHROME_BROWSER_UI_WEBUI_ASH_ENTERPRISE_REPORTING_ENTERPRISE_REPORTING_UI_H_ | ||
|
||
#include "content/public/browser/web_ui_controller.h" | ||
|
||
namespace ash::reporting { | ||
|
||
// The WebUI for chrome://enterprise-reporting | ||
class EnterpriseReportingUI : public content::WebUIController { | ||
public: | ||
explicit EnterpriseReportingUI(content::WebUI* web_ui); | ||
~EnterpriseReportingUI() override; | ||
}; | ||
|
||
} // namespace ash::reporting | ||
|
||
#endif // CHROME_BROWSER_UI_WEBUI_ASH_ENTERPRISE_REPORTING_ENTERPRISE_REPORTING_UI_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters