Commit e6a4050f authored by Trent Begin's avatar Trent Begin Committed by Chromium LUCI CQ

network-health: consolidate shared strings

The network health components are used both in //chrome and //chromeos.
Strings that are required in both locations need to be moved to
//chromeos to prevent a layering violation. This change adds a new
location for these shared strings and moves them there.

Bug: chromium:1142857
Change-Id: I2cb497ae5df82c9718f34c15ac939e0921c69174
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2586971
Commit-Queue: Trent Begin <tbegin@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#837722}
parent 457560e7
......@@ -1676,6 +1676,7 @@
</message>
<!-- Open Network (ONC)-->
<!-- TODO(crbug.com/1142857) Move these strings to //chromeos/components/network_ui -->
<message name="IDS_ONC_IPV4_ADDRESS" desc="ONC Property label for ipv4-IPAddress">
IP address
</message>
......@@ -1823,12 +1824,6 @@
<message name="IDS_ONC_EAP_USER_CERT" desc="ONC Property label for EAP User Certs">
User certificate
</message>
<message name="IDS_ONC_MAC_ADDRESS" desc="ONC Property label for MacAddress">
MAC address
</message>
<message name="IDS_ONC_NAME" desc="ONC Property label for the network Name (displayed when configuring a VPN service name)">
Service name
</message>
<message name="IDS_ONC_NOT_CONNECTED" desc="Settings > Internet, text in network summary when a network is not connecting or connected.">
Not Connected
</message>
......@@ -1940,9 +1935,6 @@
<message name="IDS_ONC_WIFI_SECURITY_EAP" desc="In settings > Internet, a string specifying security type = EAP (802.1X).">
EAP
</message>
<message name="IDS_ONC_WIFI_SIGNAL_STRENGTH" desc="ONC Property label for WiFi.SignalStrength">
Signal strength
</message>
<message name="IDS_ONC_WIFI_SSID" desc="ONC Property label for WiFi.SSID">
SSID
</message>
......@@ -2495,41 +2487,6 @@
<ph name="NETWORK_TYPE">$1<ex>Instant Tethering</ex></ph> network, signal strength <ph name="SIGNAL_STRENGTH">$2<ex>80</ex></ph>%
</message>
<!-- Common Network type strings -->
<message name="IDS_NETWORK_TYPE" desc="Label for network types">
Type
</message>
<message name="IDS_NETWORK_TYPE_ETHERNET" desc="Label for Ethernet networks.">
Ethernet
</message>
<message name="IDS_NETWORK_TYPE_WIFI" desc="Label for WiFi networks.">
Wi-Fi
</message>
<message name="IDS_NETWORK_TYPE_METERED_WIFI" desc="Label for metered Wi-Fi networks (i.e., Wi-Fi networks which have resticted data usage such as a monthly limit).">
metered Wi-Fi
</message>
<message name="IDS_NETWORK_TYPE_BLUETOOTH" desc="Label for Bluetooth networks.">
Bluetooth
</message>
<message name="IDS_NETWORK_TYPE_CELLULAR" desc="Label for Cellular networks.">
Cellular
</message>
<message name="IDS_NETWORK_TYPE_TETHER" desc="Label for Instant Tethering networks.">
Instant Tethering
</message>
<message name="IDS_NETWORK_TYPE_MOBILE_DATA" desc="Label for category which includes both Cellular and Tether networks.">
Mobile data
</message>
<message name="IDS_NETWORK_TYPE_VPN" desc="Label for VPN networks.">
VPN
</message>
<message name="IDS_NETWORK_TYPE_VPN_BUILTIN" desc="The built-in VPN types (Open VPN and L2TP/IPSec).">
OpenVPN / L2TP
</message>
<message name="IDS_NETWORK_TYPE_WIRELESS" desc="Label for wireless networks (Cellular, Tether, and WiFi.).">
Wireless
</message>
<!-- Status bar -->
<message name="IDS_STATUSBAR_NETWORK_DEVICE_CONNECTING" desc="The network device status connecting.">
Connecting...
......@@ -3747,35 +3704,6 @@
To view network UI logs, see: <ph name="DEVICE_LOG_LINK">&lt;a href="chrome://device-log"&gt;chrome://device-log&lt;/a&gt;</ph>
</message>
<!-- Network Health display strings -->
<message name="IDS_NETWORK_HEALTH_STATE" desc="Label for the current state of a networking device.">
State
</message>
<message name="IDS_NETWORK_HEALTH_STATE_UNINITIALIZED" desc="Network State - Uninitialized. This states is when a network device has not been initialized by the device.">
Uninitialized
</message>
<message name="IDS_NETWORK_HEALTH_STATE_DISABLED" desc="Network State - Disabled. This state is when the network device has been disabled (Turning off WiFi).">
Disabled
</message>
<message name="IDS_NETWORK_HEALTH_STATE_PROHIBITED" desc="Network State - Prohibited. This state represents a network device that has been explicitly disabled by admin policy.">
Prohibited
</message>
<message name="IDS_NETWORK_HEALTH_STATE_NOT_CONNECTED" desc="Network State - Not Connected. This state represents when a device is enabled, but has no active network connection.">
Not Connected
</message>
<message name="IDS_NETWORK_HEALTH_STATE_CONNECTING" desc="Network State - Connecting. This is a transient state when the network device is in the process of connecting to a network.">
Connecting
</message>
<message name="IDS_NETWORK_HEALTH_STATE_PORTAL" desc="Network State - Portal. This state represents a connected network device, but the active network is in a captive portal. (When you login at an airport and need to enter additional information before accessing the internet).">
Portal
</message>
<message name="IDS_NETWORK_HEALTH_STATE_CONNECTED" desc="Network State - Connected. This state is when a network device is connected to network, but cannot access the internet.">
Connected
</message>
<message name="IDS_NETWORK_HEALTH_STATE_ONLINE" desc="Network State - Online. This state is when a network device is connected to a network and can access the internet.">
Online
</message>
<!-- Set time/date UI display strings -->
<message name="IDS_SET_TIME_TITLE" desc="Title of the set time/date UI.">
Check your system time
......
......@@ -2051,8 +2051,6 @@ source_set("chromeos") {
"net/network_diagnostics/video_conferencing_routine.h",
"net/network_health/network_health.cc",
"net/network_health/network_health.h",
"net/network_health/network_health_localized_strings.cc",
"net/network_health/network_health_localized_strings.h",
"net/network_health/network_health_service.cc",
"net/network_health/network_health_service.h",
"net/network_portal_detector_impl.cc",
......
......@@ -2638,7 +2638,6 @@ static_library("ui") {
"//chromeos/components/account_manager",
"//chromeos/components/camera_app_ui",
"//chromeos/components/connectivity_diagnostics",
"//chromeos/components/connectivity_diagnostics:network_diagnostics_resource_provider",
"//chromeos/components/diagnostics_ui",
"//chromeos/components/drivefs/mojom:mojom",
"//chromeos/components/help_app_ui",
......@@ -2648,6 +2647,8 @@ static_library("ui") {
"//chromeos/components/multidevice",
"//chromeos/components/multidevice/debug_webui",
"//chromeos/components/multidevice/logging",
"//chromeos/components/network_ui:network_diagnostics_resource_provider",
"//chromeos/components/network_ui:network_health_localized_strings",
"//chromeos/components/phonehub",
"//chromeos/components/phonehub:debug",
"//chromeos/components/print_management",
......
......@@ -18,6 +18,7 @@
#include "chromeos/network/network_state_handler.h"
#include "chromeos/network/network_util.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" // nogncheck
#include "chromeos/strings/grit/chromeos_strings.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
......
......@@ -13,6 +13,7 @@
#include "chrome/grit/generated_resources.h"
#include "chromeos/login/login_state/login_state.h"
#include "chromeos/network/network_connection_handler.h"
#include "chromeos/strings/grit/chromeos_strings.h"
#include "components/login/localized_values_builder.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/web_ui_data_source.h"
......
......@@ -14,7 +14,6 @@
#include "base/memory/weak_ptr.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "chrome/browser/chromeos/net/network_health/network_health_localized_strings.h"
#include "chrome/browser/chromeos/net/network_health/network_health_service.h"
#include "chrome/browser/extensions/tab_helper.h"
#include "chrome/browser/ui/chrome_pages.h"
......@@ -27,7 +26,8 @@
#include "chrome/common/url_constants.h"
#include "chrome/grit/browser_resources.h"
#include "chrome/grit/generated_resources.h"
#include "chromeos/components/connectivity_diagnostics/network_diagnostics_resource_provider.h"
#include "chromeos/components/network_ui/network_diagnostics_resource_provider.h"
#include "chromeos/components/network_ui/network_health_localized_strings.h"
#include "chromeos/network/device_state.h"
#include "chromeos/network/network_configuration_handler.h"
#include "chromeos/network/network_device_handler.h"
......
......@@ -25,6 +25,7 @@
#include "chromeos/network/network_state_handler.h"
#include "chromeos/network/network_type_pattern.h"
#include "chromeos/settings/cros_settings_names.h"
#include "chromeos/strings/grit/chromeos_strings.h"
#include "content/public/browser/web_contents.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
#include "ui/base/l10n/l10n_util.h"
......
......@@ -787,6 +787,82 @@ 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>
</message>
<!-- Common Network type strings -->
<message name="IDS_NETWORK_TYPE" desc="Label for network types">
Type
</message>
<message name="IDS_NETWORK_TYPE_ETHERNET" desc="Label for Ethernet networks.">
Ethernet
</message>
<message name="IDS_NETWORK_TYPE_WIFI" desc="Label for WiFi networks.">
Wi-Fi
</message>
<message name="IDS_NETWORK_TYPE_METERED_WIFI" desc="Label for metered Wi-Fi networks (i.e., Wi-Fi networks which have resticted data usage such as a monthly limit).">
metered Wi-Fi
</message>
<message name="IDS_NETWORK_TYPE_BLUETOOTH" desc="Label for Bluetooth networks.">
Bluetooth
</message>
<message name="IDS_NETWORK_TYPE_CELLULAR" desc="Label for Cellular networks.">
Cellular
</message>
<message name="IDS_NETWORK_TYPE_TETHER" desc="Label for Instant Tethering networks.">
Instant Tethering
</message>
<message name="IDS_NETWORK_TYPE_MOBILE_DATA" desc="Label for category which includes both Cellular and Tether networks.">
Mobile data
</message>
<message name="IDS_NETWORK_TYPE_VPN" desc="Label for VPN networks.">
VPN
</message>
<message name="IDS_NETWORK_TYPE_VPN_BUILTIN" desc="The built-in VPN types (Open VPN and L2TP/IPSec).">
OpenVPN / L2TP
</message>
<message name="IDS_NETWORK_TYPE_WIRELESS" desc="Label for wireless networks (Cellular, Tether, and WiFi.).">
Wireless
</message>
<!-- Open Network (ONC)-->
<!-- TODO(crbug.com/1142857) strings are in process of being moved here from //chrome/app/ -->
<message name="IDS_ONC_MAC_ADDRESS" desc="ONC Property label for MacAddress">
MAC address
</message>
<message name="IDS_ONC_NAME" desc="ONC Property label for the network Name (displayed when configuring a VPN service name)">
Service name
</message>
<message name="IDS_ONC_WIFI_SIGNAL_STRENGTH" desc="ONC Property label for WiFi.SignalStrength">
Signal strength
</message>
<!-- Network Health display strings -->
<message name="IDS_NETWORK_HEALTH_STATE" desc="Label for the current state of a networking device.">
State
</message>
<message name="IDS_NETWORK_HEALTH_STATE_UNINITIALIZED" desc="Network State - Uninitialized. This states is when a network device has not been initialized by the device.">
Uninitialized
</message>
<message name="IDS_NETWORK_HEALTH_STATE_DISABLED" desc="Network State - Disabled. This state is when the network device has been disabled (Turning off WiFi).">
Disabled
</message>
<message name="IDS_NETWORK_HEALTH_STATE_PROHIBITED" desc="Network State - Prohibited. This state represents a network device that has been explicitly disabled by admin policy.">
Prohibited
</message>
<message name="IDS_NETWORK_HEALTH_STATE_NOT_CONNECTED" desc="Network State - Not Connected. This state represents when a device is enabled, but has no active network connection.">
Not Connected
</message>
<message name="IDS_NETWORK_HEALTH_STATE_CONNECTING" desc="Network State - Connecting. This is a transient state when the network device is in the process of connecting to a network.">
Connecting
</message>
<message name="IDS_NETWORK_HEALTH_STATE_PORTAL" desc="Network State - Portal. This state represents a connected network device, but the active network is in a captive portal. (When you login at an airport and need to enter additional information before accessing the internet).">
Portal
</message>
<message name="IDS_NETWORK_HEALTH_STATE_CONNECTED" desc="Network State - Connected. This state is when a network device is connected to network, but cannot access the internet.">
Connected
</message>
<message name="IDS_NETWORK_HEALTH_STATE_ONLINE" desc="Network State - Online. This state is when a network device is connected to a network and can access the internet.">
Online
</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
......
d41a597ce515a187b66ee7cf7b6976568ea053dd
\ No newline at end of file
9013dafa1c6c41f00c53e09acd3096244bafa4b1
\ No newline at end of file
82898559374dcc45cad368f7a7dc6a32b82371d5
\ No newline at end of file
509eaef5c12ceae5466697689ba73da4557a6b25
\ No newline at end of file
a0d29985e98ff840745363a6e1a9818744a6cbcf
\ No newline at end of file
e36634aec9d692dba967ddf20e901a56a56258d7
\ No newline at end of file
2ed3bc44d22003dca342db0cda565d8a2c7b71f6
\ No newline at end of file
5841580629bb78d572dd1982c6d66eed3bac35eb
\ No newline at end of file
54d41c50748c4c755abf885281c1c7961c9d3695
\ No newline at end of file
208d34af2948dcd1faa9dc5d77c93bfa3a14cf97
\ No newline at end of file
9fc45f49aeb471fb8d77c5fe2347c1673612bf84
\ No newline at end of file
afa20008f53a91395e93377c8bd23c122b2fc0ba
\ No newline at end of file
ba1741c811165ea93ebf764b1d80ab0a76cd7ee9
\ No newline at end of file
4339530c0fd2bb9fd96ae147f597fcb692b2064e
\ No newline at end of file
516343f416b571e0eddced03c68a62e482180df9
\ No newline at end of file
972b2018b6eaeb6ca2ca6187f4f2b07300fa59b5
\ No newline at end of file
b9b8754dbbb659b6e2a36f4b72183b8ba514aa7f
\ No newline at end of file
4ccff90d797c49bbbe6e23a32642a07003dd0b89
\ No newline at end of file
5c2ba0aeb8921c2e061170c316d3e00b852ff164
\ No newline at end of file
620e56569cac0dfeac10e7ef5e48a6dcc9ff38d2
\ No newline at end of file
1446f9c6deb37eb7627797e9f8cad0c9be0ed675
\ No newline at end of file
070304a7095b1366c54ecd1f851b02c0e73a3c5a
\ No newline at end of file
657f731c8ed39323aa52b4479f2735ac860c9929
\ No newline at end of file
......@@ -13,7 +13,7 @@ static_library("connectivity_diagnostics") {
]
deps = [
":network_diagnostics_resource_provider",
"../network_ui:network_diagnostics_resource_provider",
"//chromeos/components/web_applications",
"//chromeos/constants",
"//chromeos/resources:connectivity_diagnostics_resources",
......@@ -29,18 +29,3 @@ static_library("connectivity_diagnostics") {
group("closure_compile") {
deps = [ "resources:closure_compile_module" ]
}
source_set("network_diagnostics_resource_provider") {
sources = [
"network_diagnostics_resource_provider.cc",
"network_diagnostics_resource_provider.h",
]
deps = [
"//chromeos/strings/",
"//content/public/browser",
"//ui/base",
"//ui/resources:webui_generated_resources_grd",
"//ui/webui",
]
}
......@@ -6,8 +6,8 @@
#include <utility>
#include "chromeos/components/connectivity_diagnostics/network_diagnostics_resource_provider.h"
#include "chromeos/components/connectivity_diagnostics/url_constants.h"
#include "chromeos/components/network_ui/network_diagnostics_resource_provider.h"
#include "chromeos/grit/connectivity_diagnostics_resources.h"
#include "chromeos/grit/connectivity_diagnostics_resources_map.h"
#include "chromeos/services/network_health/public/mojom/network_diagnostics.mojom.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.
assert(is_chromeos, "Network Health is Chrome OS only")
source_set("network_diagnostics_resource_provider") {
sources = [
"network_diagnostics_resource_provider.cc",
"network_diagnostics_resource_provider.h",
]
deps = [
"//chromeos/strings/",
"//content/public/browser",
"//ui/base",
"//ui/resources:webui_generated_resources_grd_grit",
]
}
source_set("network_health_localized_strings") {
sources = [
"network_health_localized_strings.cc",
"network_health_localized_strings.h",
]
deps = [
"//chromeos/strings/",
"//content/public/browser",
"//ui/base",
]
}
include_rules = [
"-chrome",
"+chromeos/strings/grit/chromeos_strings.h",
"+content/public/browser",
"+ui/base",
"+ui/resources",
]
......@@ -2,7 +2,7 @@
// 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/network_diagnostics_resource_provider.h"
#include "chromeos/components/network_ui/network_diagnostics_resource_provider.h"
#include "chromeos/strings/grit/chromeos_strings.h"
#include "content/public/browser/web_ui_data_source.h"
......
......@@ -2,8 +2,8 @@
// 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_NETWORK_DIAGNOSTICS_RESOURCE_PROVIDER_H_
#define CHROMEOS_COMPONENTS_CONNECTIVITY_DIAGNOSTICS_NETWORK_DIAGNOSTICS_RESOURCE_PROVIDER_H_
#ifndef CHROMEOS_COMPONENTS_NETWORK_UI_NETWORK_DIAGNOSTICS_RESOURCE_PROVIDER_H_
#define CHROMEOS_COMPONENTS_NETWORK_UI_NETWORK_DIAGNOSTICS_RESOURCE_PROVIDER_H_
namespace content {
class WebUIDataSource;
......@@ -19,4 +19,4 @@ void AddResources(content::WebUIDataSource* html_source);
} // namespace network_diagnostics
} // namespace chromeos
#endif // CHROMEOS_COMPONENTS_CONNECTIVITY_DIAGNOSTICS_NETWORK_DIAGNOSTICS_RESOURCE_PROVIDER_H_
#endif // CHROMEOS_COMPONENTS_NETWORK_UI_NETWORK_DIAGNOSTICS_RESOURCE_PROVIDER_H_
......@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/chromeos/net/network_health/network_health_localized_strings.h"
#include "chromeos/components/network_ui/network_health_localized_strings.h"
#include "chrome/browser/ui/webui/webui_util.h"
#include "chrome/grit/generated_resources.h"
#include "chromeos/strings/grit/chromeos_strings.h"
#include "content/public/browser/web_ui_data_source.h"
#include "ui/base/webui/web_ui_util.h"
namespace chromeos {
......@@ -24,12 +24,25 @@ constexpr webui::LocalizedString kLocalizedStrings[] = {
{"NetworkHealthStatePortal", IDS_NETWORK_HEALTH_STATE_PORTAL},
{"NetworkHealthStateConnected", IDS_NETWORK_HEALTH_STATE_CONNECTED},
{"NetworkHealthStateOnline", IDS_NETWORK_HEALTH_STATE_ONLINE},
{"OncType", IDS_NETWORK_TYPE},
{"OncName", IDS_ONC_NAME},
{"OncTypeCellular", IDS_NETWORK_TYPE_CELLULAR},
{"OncTypeEthernet", IDS_NETWORK_TYPE_ETHERNET},
{"OncTypeMobile", IDS_NETWORK_TYPE_MOBILE_DATA},
{"OncTypeTether", IDS_NETWORK_TYPE_TETHER},
{"OncTypeVPN", IDS_NETWORK_TYPE_VPN},
{"OncTypeWireless", IDS_NETWORK_TYPE_WIRELESS},
{"OncTypeWiFi", IDS_NETWORK_TYPE_WIFI},
{"OncWiFi-SignalStrength", IDS_ONC_WIFI_SIGNAL_STRENGTH},
{"OncMacAddress", IDS_ONC_MAC_ADDRESS},
};
} // namespace
void AddLocalizedStrings(content::WebUIDataSource* html_source) {
AddLocalizedStringsBulk(html_source, kLocalizedStrings);
for (const auto& str : kLocalizedStrings)
html_source->AddLocalizedString(str.name, str.id);
}
} // namespace network_health
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_NET_NETWORK_HEALTH_NETWORK_HEALTH_LOCALIZED_STRINGS_H_
#define CHROME_BROWSER_CHROMEOS_NET_NETWORK_HEALTH_NETWORK_HEALTH_LOCALIZED_STRINGS_H_
#ifndef CHROMEOS_COMPONENTS_NETWORK_UI_NETWORK_HEALTH_LOCALIZED_STRINGS_H_
#define CHROMEOS_COMPONENTS_NETWORK_UI_NETWORK_HEALTH_LOCALIZED_STRINGS_H_
namespace content {
class WebUIDataSource;
......@@ -18,4 +18,4 @@ void AddLocalizedStrings(content::WebUIDataSource* html_source);
} // namespace network_health
} // namespace chromeos
#endif // CHROME_BROWSER_CHROMEOS_NET_NETWORK_HEALTH_NETWORK_HEALTH_LOCALIZED_STRINGS_H_
#endif // CHROMEOS_COMPONENTS_NETWORK_UI_NETWORK_HEALTH_LOCALIZED_STRINGS_H_
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