Commit 81a6d4cd authored by Mahmoud Gawad's avatar Mahmoud Gawad Committed by Commit Bot

[Telemetry SWX] move creation behind build flag

Currently, telemetry_extension_ui files are behind !is_official_build
flag, while creation of the SystemAppType::TELEMETRY is not. This
generates an error when the is_official_build=true indicating that the
TelemetryExtension cannot be installed because there are no resources.

To achieve consistency, move the creation of SystemWebType::TELEMETRY
behind !defined(OFFICIAL_BUILD).

Future work, when Telemetry SWX is ready to be shipped with Chrome, move
out the SystemApp and resources creation outside !is_official_build
flag.

Bug: b:153335834
Change-Id: Id4add254e0e032c201c6dd7e54020ab6f262e802
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2346659Reviewed-by: default avatarGiovanni Ortuño Urquidi <ortuno@chromium.org>
Reviewed-by: default avatarOleh Lamzin <lamzin@google.com>
Commit-Queue: Mahmoud Gawad <mgawad@google.com>
Cr-Commit-Position: refs/heads/master@{#797149}
parent e9d8ac22
......@@ -166,13 +166,13 @@ base::flat_map<SystemAppType, SystemAppInfo> CreateSystemWebApps() {
infos.at(SystemAppType::PRINT_MANAGEMENT).minimum_window_size = {600, 320};
}
#if !defined(OFFICIAL_BUILD)
if (SystemWebAppManager::IsAppEnabled(SystemAppType::TELEMETRY)) {
infos.emplace(SystemAppType::TELEMETRY,
SystemAppInfo("Telemetry",
GURL("chrome://telemetry-extension/pwa.html")));
}
#if !defined(OFFICIAL_BUILD)
infos.emplace(
SystemAppType::SAMPLE,
SystemAppInfo(
......@@ -291,10 +291,10 @@ bool SystemWebAppManager::IsAppEnabled(SystemAppType type) {
case SystemAppType::PRINT_MANAGEMENT:
return base::FeatureList::IsEnabled(
chromeos::features::kPrintJobManagementApp);
#if !defined(OFFICIAL_BUILD)
case SystemAppType::TELEMETRY:
return base::FeatureList::IsEnabled(
chromeos::features::kTelemetryExtension);
#if !defined(OFFICIAL_BUILD)
case SystemAppType::SAMPLE:
NOTREACHED();
return false;
......
......@@ -54,8 +54,8 @@ enum class SystemAppType {
MEDIA,
HELP,
PRINT_MANAGEMENT,
TELEMETRY,
#if !defined(OFFICIAL_BUILD)
TELEMETRY,
SAMPLE,
#endif // !defined(OFFICIAL_BUILD)
};
......
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