Commit 49efc765 authored by Trent Begin's avatar Trent Begin Committed by Commit Bot

Add System Web App framework for connectivity diagnostics app

This adds a skeleton SWA that will be used to replace the current
connectivity diagnostics Chrome app with a WebUI based app. This SWA is
gated behind a feature flag to hide it during development.

Bug: chromium:1140611
Change-Id: I52ffd2c21538a26d770b6344d3b6fe4f8a4fec5b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2490504Reviewed-by: default avatarBrian White <bcwhite@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarGiovanni Ortuño Urquidi <ortuno@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Auto-Submit: Trent Begin <tbegin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821857}
parent be0013d4
...@@ -2312,6 +2312,7 @@ static_library("browser") { ...@@ -2312,6 +2312,7 @@ static_library("browser") {
"//chromeos/audio", "//chromeos/audio",
"//chromeos/components/camera_app_ui", "//chromeos/components/camera_app_ui",
"//chromeos/components/camera_app_ui:mojo_bindings", "//chromeos/components/camera_app_ui:mojo_bindings",
"//chromeos/components/connectivity_diagnostics",
"//chromeos/components/help_app_ui", "//chromeos/components/help_app_ui",
"//chromeos/components/help_app_ui:mojo_bindings", "//chromeos/components/help_app_ui:mojo_bindings",
"//chromeos/components/local_search_service", "//chromeos/components/local_search_service",
......
...@@ -112,6 +112,7 @@ source_set("chromeos") { ...@@ -112,6 +112,7 @@ source_set("chromeos") {
"//chromeos/components/camera_app_ui", "//chromeos/components/camera_app_ui",
"//chromeos/components/cdm_factory_daemon:cdm_factory_daemon_browser", "//chromeos/components/cdm_factory_daemon:cdm_factory_daemon_browser",
"//chromeos/components/chromebox_for_meetings/buildflags", "//chromeos/components/chromebox_for_meetings/buildflags",
"//chromeos/components/connectivity_diagnostics",
"//chromeos/components/diagnostics_ui", "//chromeos/components/diagnostics_ui",
"//chromeos/components/drivefs", "//chromeos/components/drivefs",
"//chromeos/components/drivefs/mojom", "//chromeos/components/drivefs/mojom",
...@@ -190,6 +191,7 @@ source_set("chromeos") { ...@@ -190,6 +191,7 @@ source_set("chromeos") {
"//chromeos/login/session", "//chromeos/login/session",
"//chromeos/memory", "//chromeos/memory",
"//chromeos/network", "//chromeos/network",
"//chromeos/resources:connectivity_diagnostics_resources_grit",
"//chromeos/resources:diagnostics_app_resources_grit", "//chromeos/resources:diagnostics_app_resources_grit",
"//chromeos/resources:help_app_resources_grit", "//chromeos/resources:help_app_resources_grit",
"//chromeos/resources:media_app_resources_grit", "//chromeos/resources:media_app_resources_grit",
...@@ -2790,6 +2792,8 @@ source_set("chromeos") { ...@@ -2790,6 +2792,8 @@ source_set("chromeos") {
"web_applications/chrome_help_app_ui_delegate.h", "web_applications/chrome_help_app_ui_delegate.h",
"web_applications/chrome_media_app_ui_delegate.cc", "web_applications/chrome_media_app_ui_delegate.cc",
"web_applications/chrome_media_app_ui_delegate.h", "web_applications/chrome_media_app_ui_delegate.h",
"web_applications/connectivity_diagnostics_system_web_app_info.cc",
"web_applications/connectivity_diagnostics_system_web_app_info.h",
"web_applications/crosh_loader.cc", "web_applications/crosh_loader.cc",
"web_applications/crosh_loader.h", "web_applications/crosh_loader.h",
"web_applications/crosh_loader_factory.cc", "web_applications/crosh_loader_factory.cc",
......
// Copyright 2020 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/chromeos/web_applications/connectivity_diagnostics_system_web_app_info.h"
#include <memory>
#include "chrome/browser/chromeos/web_applications/system_web_app_install_utils.h"
#include "chrome/common/web_application_info.h"
#include "chromeos/components/connectivity_diagnostics/url_constants.h"
#include "chromeos/grit/connectivity_diagnostics_resources.h"
#include "chromeos/strings/grit/chromeos_strings.h"
#include "third_party/blink/public/mojom/manifest/display_mode.mojom.h"
#include "ui/base/l10n/l10n_util.h"
#include "url/gurl.h"
std::unique_ptr<WebApplicationInfo>
CreateWebAppInfoForConnectivityDiagnosticsSystemWebApp() {
std::unique_ptr<WebApplicationInfo> info =
std::make_unique<WebApplicationInfo>();
info->start_url = GURL(chromeos::kChromeUIConnectivityDiagnosticsUrl);
info->scope = GURL(chromeos::kChromeUIConnectivityDiagnosticsUrl);
info->title = l10n_util::GetStringUTF16(IDS_CONNECTIVITY_DIAGNOSTICS_TITLE);
web_app::CreateIconInfoForSystemWebApp(
info->start_url,
{{"app_icon_128.png", 128,
IDR_CONNECTIVITY_DIAGNOSTICS_APP_ICON_128_PNG}},
*info);
info->theme_color = 0xFFFFFFFF;
info->background_color = 0xFFFFFFFF;
info->display_mode = blink::mojom::DisplayMode::kStandalone;
info->open_as_window = true;
return info;
}
// Copyright 2020 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.
#ifndef CHROME_BROWSER_CHROMEOS_WEB_APPLICATIONS_CONNECTIVITY_DIAGNOSTICS_SYSTEM_WEB_APP_INFO_H_
#define CHROME_BROWSER_CHROMEOS_WEB_APPLICATIONS_CONNECTIVITY_DIAGNOSTICS_SYSTEM_WEB_APP_INFO_H_
#include <memory>
struct WebApplicationInfo;
// Returns a WebApplicationInfo used to install the app.
std::unique_ptr<WebApplicationInfo>
CreateWebAppInfoForConnectivityDiagnosticsSystemWebApp();
#endif // CHROME_BROWSER_CHROMEOS_WEB_APPLICATIONS_CONNECTIVITY_DIAGNOSTICS_SYSTEM_WEB_APP_INFO_H_
...@@ -2602,6 +2602,7 @@ static_library("ui") { ...@@ -2602,6 +2602,7 @@ static_library("ui") {
"//chromeos/components/bloom/public/cpp", "//chromeos/components/bloom/public/cpp",
"//chromeos/components/bloom/public/cpp:bloom_controller_factory", "//chromeos/components/bloom/public/cpp:bloom_controller_factory",
"//chromeos/components/camera_app_ui", "//chromeos/components/camera_app_ui",
"//chromeos/components/connectivity_diagnostics",
"//chromeos/components/diagnostics_ui", "//chromeos/components/diagnostics_ui",
"//chromeos/components/drivefs/mojom:mojom", "//chromeos/components/drivefs/mojom:mojom",
"//chromeos/components/help_app_ui", "//chromeos/components/help_app_ui",
......
...@@ -200,6 +200,8 @@ ...@@ -200,6 +200,8 @@
#include "chrome/browser/ui/webui/settings/chromeos/os_settings_ui.h" #include "chrome/browser/ui/webui/settings/chromeos/os_settings_ui.h"
#include "chromeos/components/camera_app_ui/camera_app_ui.h" #include "chromeos/components/camera_app_ui/camera_app_ui.h"
#include "chromeos/components/camera_app_ui/url_constants.h" #include "chromeos/components/camera_app_ui/url_constants.h"
#include "chromeos/components/connectivity_diagnostics/connectivity_diagnostics_ui.h"
#include "chromeos/components/connectivity_diagnostics/url_constants.h"
#include "chromeos/components/diagnostics_ui/diagnostics_ui.h" #include "chromeos/components/diagnostics_ui/diagnostics_ui.h"
#include "chromeos/components/diagnostics_ui/url_constants.h" #include "chromeos/components/diagnostics_ui/url_constants.h"
#include "chromeos/components/help_app_ui/help_app_ui.h" #include "chromeos/components/help_app_ui/help_app_ui.h"
...@@ -657,6 +659,11 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, ...@@ -657,6 +659,11 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
return &NewWebUI<chromeos::cellular_setup::CellularSetupDialogUI>; return &NewWebUI<chromeos::cellular_setup::CellularSetupDialogUI>;
if (url.host_piece() == chrome::kChromeUICertificateManagerHost) if (url.host_piece() == chrome::kChromeUICertificateManagerHost)
return &NewWebUI<chromeos::CertificateManagerDialogUI>; return &NewWebUI<chromeos::CertificateManagerDialogUI>;
if (base::FeatureList::IsEnabled(
chromeos::features::kConnectivityDiagnosticsWebUi) &&
url.host_piece() == chromeos::kChromeUIConnectivityDiagnosticsHost) {
return &NewWebUI<chromeos::ConnectivityDiagnosticsUI>;
}
if (url.host_piece() == chrome::kChromeUICrostiniInstallerHost) if (url.host_piece() == chrome::kChromeUICrostiniInstallerHost)
return &NewWebUI<chromeos::CrostiniInstallerUI>; return &NewWebUI<chromeos::CrostiniInstallerUI>;
if (chromeos::CrostiniUpgraderUI::IsEnabled() && if (chromeos::CrostiniUpgraderUI::IsEnabled() &&
......
...@@ -45,6 +45,7 @@ source_set("common") { ...@@ -45,6 +45,7 @@ source_set("common") {
deps += [ deps += [
"//ash/public/cpp", "//ash/public/cpp",
"//chromeos/components/camera_app_ui", "//chromeos/components/camera_app_ui",
"//chromeos/components/connectivity_diagnostics",
"//chromeos/components/diagnostics_ui", "//chromeos/components/diagnostics_ui",
"//chromeos/components/help_app_ui", "//chromeos/components/help_app_ui",
"//chromeos/components/media_app_ui", "//chromeos/components/media_app_ui",
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include "base/values.h" #include "base/values.h"
#include "chrome/browser/chromeos/policy/system_features_disable_list_policy_handler.h" #include "chrome/browser/chromeos/policy/system_features_disable_list_policy_handler.h"
#include "chrome/browser/chromeos/web_applications/camera_system_web_app_info.h" #include "chrome/browser/chromeos/web_applications/camera_system_web_app_info.h"
#include "chrome/browser/chromeos/web_applications/connectivity_diagnostics_system_web_app_info.h"
#include "chrome/browser/chromeos/web_applications/default_web_app_ids.h" #include "chrome/browser/chromeos/web_applications/default_web_app_ids.h"
#include "chrome/browser/chromeos/web_applications/diagnostics_system_web_app_info.h" #include "chrome/browser/chromeos/web_applications/diagnostics_system_web_app_info.h"
#include "chrome/browser/chromeos/web_applications/help_app_web_app_info.h" #include "chrome/browser/chromeos/web_applications/help_app_web_app_info.h"
...@@ -56,6 +57,7 @@ ...@@ -56,6 +57,7 @@
#include "chrome/browser/chromeos/web_applications/terminal_source.h" #include "chrome/browser/chromeos/web_applications/terminal_source.h"
#include "chrome/browser/chromeos/web_applications/terminal_system_web_app_info.h" #include "chrome/browser/chromeos/web_applications/terminal_system_web_app_info.h"
#include "chromeos/components/camera_app_ui/url_constants.h" #include "chromeos/components/camera_app_ui/url_constants.h"
#include "chromeos/components/connectivity_diagnostics/url_constants.h"
#include "chromeos/components/help_app_ui/url_constants.h" #include "chromeos/components/help_app_ui/url_constants.h"
#include "chromeos/components/media_app_ui/url_constants.h" #include "chromeos/components/media_app_ui/url_constants.h"
#include "chromeos/constants/chromeos_features.h" #include "chromeos/constants/chromeos_features.h"
...@@ -190,6 +192,17 @@ base::flat_map<SystemAppType, SystemAppInfo> CreateSystemWebApps() { ...@@ -190,6 +192,17 @@ base::flat_map<SystemAppType, SystemAppInfo> CreateSystemWebApps() {
&CreateWebAppInfoForScanningSystemWebApp))); &CreateWebAppInfoForScanningSystemWebApp)));
} }
if (SystemWebAppManager::IsAppEnabled(
SystemAppType::CONNECTIVITY_DIAGNOSTICS)) {
infos.emplace(
SystemAppType::CONNECTIVITY_DIAGNOSTICS,
SystemAppInfo(
"ConnectivityDiagnostics",
GURL(chromeos::kChromeUIConnectivityDiagnosticsUrl),
base::BindRepeating(
&CreateWebAppInfoForConnectivityDiagnosticsSystemWebApp)));
}
#if !defined(OFFICIAL_BUILD) #if !defined(OFFICIAL_BUILD)
if (SystemWebAppManager::IsAppEnabled(SystemAppType::TELEMETRY)) { if (SystemWebAppManager::IsAppEnabled(SystemAppType::TELEMETRY)) {
infos.emplace( infos.emplace(
...@@ -338,6 +351,9 @@ bool SystemWebAppManager::IsAppEnabled(SystemAppType type) { ...@@ -338,6 +351,9 @@ bool SystemWebAppManager::IsAppEnabled(SystemAppType type) {
return base::FeatureList::IsEnabled(chromeos::features::kScanningUI); return base::FeatureList::IsEnabled(chromeos::features::kScanningUI);
case SystemAppType::DIAGNOSTICS: case SystemAppType::DIAGNOSTICS:
return base::FeatureList::IsEnabled(chromeos::features::kDiagnosticsApp); return base::FeatureList::IsEnabled(chromeos::features::kDiagnosticsApp);
case SystemAppType::CONNECTIVITY_DIAGNOSTICS:
return base::FeatureList::IsEnabled(
chromeos::features::kConnectivityDiagnosticsWebUi);
#if !defined(OFFICIAL_BUILD) #if !defined(OFFICIAL_BUILD)
case SystemAppType::TELEMETRY: case SystemAppType::TELEMETRY:
return base::FeatureList::IsEnabled( return base::FeatureList::IsEnabled(
......
...@@ -54,6 +54,7 @@ enum class SystemAppType { ...@@ -54,6 +54,7 @@ enum class SystemAppType {
PRINT_MANAGEMENT, PRINT_MANAGEMENT,
SCANNING, SCANNING,
DIAGNOSTICS, DIAGNOSTICS,
CONNECTIVITY_DIAGNOSTICS,
#if !defined(OFFICIAL_BUILD) #if !defined(OFFICIAL_BUILD)
FILE_MANAGER, FILE_MANAGER,
TELEMETRY, TELEMETRY,
......
...@@ -185,6 +185,7 @@ template("chrome_extra_paks") { ...@@ -185,6 +185,7 @@ template("chrome_extra_paks") {
"$root_gen_dir/chromeos/chromeos_print_management_resources.pak", "$root_gen_dir/chromeos/chromeos_print_management_resources.pak",
"$root_gen_dir/chromeos/chromeos_resources.pak", "$root_gen_dir/chromeos/chromeos_resources.pak",
"$root_gen_dir/chromeos/chromeos_scanning_app_resources.pak", "$root_gen_dir/chromeos/chromeos_scanning_app_resources.pak",
"$root_gen_dir/chromeos/connectivity_diagnostics_resources.pak",
"$root_gen_dir/third_party/ink/ink_resources.pak", "$root_gen_dir/third_party/ink/ink_resources.pak",
"$root_gen_dir/ui/file_manager/file_manager_resources.pak", "$root_gen_dir/ui/file_manager/file_manager_resources.pak",
] ]
...@@ -202,6 +203,7 @@ template("chrome_extra_paks") { ...@@ -202,6 +203,7 @@ template("chrome_extra_paks") {
"//chrome/browser/supervised_user:supervised_user_unscaled_resources", "//chrome/browser/supervised_user:supervised_user_unscaled_resources",
"//chromeos/resources", "//chromeos/resources",
"//chromeos/resources:camera_app_resources", "//chromeos/resources:camera_app_resources",
"//chromeos/resources:connectivity_diagnostics_resources",
"//chromeos/resources:diagnostics_app_resources", "//chromeos/resources:diagnostics_app_resources",
"//chromeos/resources:help_app_bundle_resources", "//chromeos/resources:help_app_bundle_resources",
"//chromeos/resources:help_app_resources", "//chromeos/resources:help_app_resources",
......
...@@ -570,6 +570,11 @@ Try tapping the mic to ask me anything. ...@@ -570,6 +570,11 @@ Try tapping the mic to ask me anything.
<ph name="QUERY_TEXT">$1<ex>prodotto</ex></ph> · <ph name="SOURCE_LANGUAGE_NAME">$2<ex>Italian</ex></ph> <ph name="QUERY_TEXT">$1<ex>prodotto</ex></ph> · <ph name="SOURCE_LANGUAGE_NAME">$2<ex>Italian</ex></ph>
</message> </message>
<!-- Network / Connectivity Diagnostics -->
<message name="IDS_CONNECTIVITY_DIAGNOSTICS_TITLE" desc="The label for connectivity diagnostics application that shows potential issues with the network connections">
Connectivity Diagnostics
</message>
</messages> </messages>
</release> </release>
</grit> </grit>
8b449aa5ca9b25e2af2244e6f4246cf4cae55340
\ No newline at end of file
...@@ -48,6 +48,7 @@ group("closure_compile") { ...@@ -48,6 +48,7 @@ group("closure_compile") {
testonly = true testonly = true
deps = [ deps = [
"//chromeos/components/camera_app_ui:closure_compile", "//chromeos/components/camera_app_ui:closure_compile",
"//chromeos/components/connectivity_diagnostics:closure_compile",
"//chromeos/components/diagnostics_ui:closure_compile", "//chromeos/components/diagnostics_ui:closure_compile",
"//chromeos/components/help_app_ui:closure_compile", "//chromeos/components/help_app_ui:closure_compile",
"//chromeos/components/media_app_ui:closure_compile", "//chromeos/components/media_app_ui:closure_compile",
......
# Copyright 2020 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.
assert(is_chromeos, "Connectivity Diagnostics is Chrome OS only")
static_library("connectivity_diagnostics") {
sources = [
"connectivity_diagnostics_ui.cc",
"connectivity_diagnostics_ui.h",
"url_constants.cc",
"url_constants.h",
]
deps = [
"//chromeos/components/web_applications",
"//chromeos/constants",
"//chromeos/resources:connectivity_diagnostics_resources",
"//chromeos/strings/",
"//content/public/browser",
"//ui/base",
"//ui/resources",
"//ui/webui",
]
}
group("closure_compile") {
deps = [ "resources:closure_compile_module" ]
}
include_rules = [
"-chrome",
"+chromeos/strings/grit/chromeos_strings.h",
"+content/public/browser",
"+ui/base",
"+ui/resources",
"+ui/webui",
]
// Copyright 2020 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 "chromeos/components/connectivity_diagnostics/connectivity_diagnostics_ui.h"
#include "chromeos/components/connectivity_diagnostics/url_constants.h"
#include "chromeos/grit/connectivity_diagnostics_resources.h"
#include "chromeos/grit/connectivity_diagnostics_resources_map.h"
#include "chromeos/strings/grit/chromeos_strings.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui_data_source.h"
namespace chromeos {
namespace {
constexpr char kGeneratedPath[] =
"@out_folder@/gen/chromeos/components/connectivity_diagnostics/"
"resources/preprocessed/";
// TODO(crbug/1051793): Replace with webui::SetUpWebUIDataSource() once it no
// longer requires a dependency on //chrome/browser.
void SetUpWebUIDataSource(content::WebUIDataSource* source,
base::span<const GritResourceMap> resources,
const std::string& generated_path,
int default_resource) {
for (const auto& resource : resources) {
std::string path = resource.name;
if (path.rfind(generated_path, 0) == 0)
path = path.substr(generated_path.size());
source->AddResourcePath(path, resource.value);
}
source->SetDefaultResource(default_resource);
}
} // namespace
ConnectivityDiagnosticsUI::ConnectivityDiagnosticsUI(content::WebUI* web_ui)
: ui::MojoWebUIController(web_ui, /*enable_chrome_send=*/true) {
content::WebUIDataSource* source =
content::WebUIDataSource::Create(kChromeUIConnectivityDiagnosticsHost);
source->OverrideContentSecurityPolicy(
network::mojom::CSPDirectiveName::ScriptSrc,
"script-src chrome://resources chrome://test 'self';");
source->DisableTrustedTypesCSP();
source->UseStringsJs();
source->EnableReplaceI18nInJS();
const auto resources = base::make_span(kConnectivityDiagnosticsResources,
kConnectivityDiagnosticsResourcesSize);
SetUpWebUIDataSource(source, resources, kGeneratedPath,
IDR_CONNECTIVITY_DIAGNOSTICS_INDEX_HTML);
source->AddLocalizedString("appTitle", IDS_CONNECTIVITY_DIAGNOSTICS_TITLE);
content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(),
source);
}
ConnectivityDiagnosticsUI::~ConnectivityDiagnosticsUI() = default;
WEB_UI_CONTROLLER_TYPE_IMPL(ConnectivityDiagnosticsUI)
} // namespace chromeos
// Copyright 2020 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.
#ifndef CHROMEOS_COMPONENTS_CONNECTIVITY_DIAGNOSTICS_CONNECTIVITY_DIAGNOSTICS_UI_H_
#define CHROMEOS_COMPONENTS_CONNECTIVITY_DIAGNOSTICS_CONNECTIVITY_DIAGNOSTICS_UI_H_
#include "ui/webui/mojo_web_ui_controller.h"
namespace chromeos {
class ConnectivityDiagnosticsUI : public ui::MojoWebUIController {
public:
explicit ConnectivityDiagnosticsUI(content::WebUI* web_ui);
~ConnectivityDiagnosticsUI() override;
ConnectivityDiagnosticsUI(const ConnectivityDiagnosticsUI&) = delete;
ConnectivityDiagnosticsUI& operator=(const ConnectivityDiagnosticsUI&) =
delete;
WEB_UI_CONTROLLER_TYPE_DECL();
};
} // namespace chromeos
#endif // CHROMEOS_COMPONENTS_CONNECTIVITY_DIAGNOSTICS_CONNECTIVITY_DIAGNOSTICS_UI_H_
# Copyright 2020 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("//third_party/closure_compiler/compile_js.gni")
import("//tools/grit/preprocess_grit.gni")
import("//tools/polymer/html_to_js.gni")
import("//ui/webui/resources/tools/generate_grd.gni")
preprocess_folder = "preprocessed"
preprocess_gen_manifest = "preprocessed_gen_manifest.json"
js_type_check("closure_compile_module") {
is_polymer3 = true
deps = [ ":connectivity_diagnostics" ]
}
js_library("connectivity_diagnostics") {
deps = [
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/js:i18n_behavior.m",
]
}
generate_grd("build_grd") {
deps = [ ":preprocess_generated" ]
manifest_files = [ "$target_gen_dir/$preprocess_gen_manifest" ]
input_files_base_dir = rebase_path(".", "//")
input_files = [
"index.html",
"app_icon_128.png",
]
grd_prefix = "connectivity_diagnostics"
out_grd = "$target_gen_dir/connectivity_diagnostics_resources.grd"
}
preprocess_grit("preprocess_generated") {
deps = [ ":web_components" ]
in_folder = target_gen_dir
out_folder = "$target_gen_dir/$preprocess_folder"
out_manifest = "$target_gen_dir/$preprocess_gen_manifest"
in_files = [ "connectivity_diagnostics.js" ]
}
html_to_js("web_components") {
js_files = [ "connectivity_diagnostics.js" ]
}
<style include="cr-shared-style">
:host {
font-family: Roboto, sans-serif;
font-size: 75%;
font-weight: 500;
}
</style>
<h1 id="appTitle">[[i18n('appTitle')]]</h1>
// Copyright 2020 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://resources/cr_elements/shared_style_css.m.js';
import './strings.m.js';
import {I18nBehavior} from 'chrome://resources/js/i18n_behavior.m.js';
import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
/**
* @fileoverview
* Polymer element connectivity diagnostics UI.
*/
Polymer({
is: 'connectivity-diagnostics',
_template: html`{__html_template__}`,
behaviors: [I18nBehavior],
});
<!-- Copyright 2020 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. -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>$i18n{appTitle}</title>
</head>
<body>
<connectivity-diagnostics></connectivity-diagnostics>
<script type="module" src="connectivity_diagnostics.js"></script>
</body>
</html>
// Copyright 2020 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 "chromeos/components/connectivity_diagnostics/url_constants.h"
namespace chromeos {
const char kChromeUIConnectivityDiagnosticsHost[] = "connectivity-diagnostics";
const char kChromeUIConnectivityDiagnosticsUrl[] =
"chrome://connectivity-diagnostics";
} // namespace chromeos
// Copyright 2020 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.
#ifndef CHROMEOS_COMPONENTS_CONNECTIVITY_DIAGNOSTICS_URL_CONSTANTS_H_
#define CHROMEOS_COMPONENTS_CONNECTIVITY_DIAGNOSTICS_URL_CONSTANTS_H_
namespace chromeos {
extern const char kChromeUIConnectivityDiagnosticsHost[];
extern const char kChromeUIConnectivityDiagnosticsUrl[];
} // namespace chromeos
#endif // CHROMEOS_COMPONENTS_CONNECTIVITY_DIAGNOSTICS_URL_CONSTANTS_H_
...@@ -66,6 +66,36 @@ grit("camera_app_resources") { ...@@ -66,6 +66,36 @@ grit("camera_app_resources") {
] ]
} }
# Resources used by chrome://connectivity-diagnostics
grit("connectivity_diagnostics_resources") {
# These arguments are needed since the grd is generated at build time.
enable_input_discovery_for_gn_analyze = false
defines =
[ "SHARED_INTERMEDIATE_DIR=" + rebase_path(root_gen_dir, root_build_dir) ]
conn_diag_gen_dir =
"$root_gen_dir/chromeos/components/connectivity_diagnostics/resources"
source = "$conn_diag_gen_dir/connectivity_diagnostics_resources.grd"
deps =
[ "//chromeos/components/connectivity_diagnostics/resources:build_grd" ]
outputs = [
"connectivity_diagnostics_resources.pak",
"grit/connectivity_diagnostics_resources.h",
"grit/connectivity_diagnostics_resources_map.cc",
"grit/connectivity_diagnostics_resources_map.h",
]
grit_flags = [
"-E",
"root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir),
"-E",
"root_src_dir=" + rebase_path("//", root_build_dir),
]
output_dir = "$root_gen_dir/chromeos"
}
# Resources used by chrome://file-manager # Resources used by chrome://file-manager
if (!is_official_build) { if (!is_official_build) {
grit("file_manager_resources") { grit("file_manager_resources") {
......
...@@ -311,6 +311,10 @@ ...@@ -311,6 +311,10 @@
"chromeos/components/camera_app_ui/resources/strings/camera_strings.grd": { "chromeos/components/camera_app_ui/resources/strings/camera_strings.grd": {
"messages": [2515], "messages": [2515],
}, },
"<(SHARED_INTERMEDIATE_DIR)/chromeos/components/connectivity_diagnostics/resources/connectivity_diagnostics_resources.grd": {
"META": {"sizes": {"includes": [50],}},
"includes": [2516],
},
"chromeos/components/diagnostics_ui/resources/diagnostics_app_resources.grd": { "chromeos/components/diagnostics_ui/resources/diagnostics_app_resources.grd": {
"includes": [2517], "includes": [2517],
}, },
......
...@@ -19392,6 +19392,7 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -19392,6 +19392,7 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</obsolete> </obsolete>
</suffix> </suffix>
<suffix name="Camera" label="Camera"/> <suffix name="Camera" label="Camera"/>
<suffix name="ConnectivityDiagnostics" label="Connectivity Diagnostics"/>
<suffix name="Diagnostics" label="Diagnostics"/> <suffix name="Diagnostics" label="Diagnostics"/>
<suffix name="Discover" label="Discovery"> <suffix name="Discover" label="Discovery">
<obsolete> <obsolete>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment