Commit 6d5a1711 authored by Steven Bennetts's avatar Steven Bennetts Committed by Commit Bot

CrOS: network_ui: Use cr.define for network_ui

This includes the following chrome://network cleanup:
* Updates network_ui.js to use cr.define.
* Replaces local types OncMojo types.
* Cleans up html import order.
* Eliminates a duplicate string in network_ui.cc.

BUG=921726

Change-Id: Ibeb15047b4b0fd7fdfe2ab7fc05ba65dea2b9560
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2242532
Commit-Queue: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarAzeem Arshad <azeemarshad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#779522}
parent b3fa01a7
...@@ -18,6 +18,8 @@ js_library("network_ui") { ...@@ -18,6 +18,8 @@ js_library("network_ui") {
"//ui/webui/resources/cr_components/chromeos/network:onc_mojo", "//ui/webui/resources/cr_components/chromeos/network:onc_mojo",
"//ui/webui/resources/js:load_time_data", "//ui/webui/resources/js:load_time_data",
"//ui/webui/resources/js:util", "//ui/webui/resources/js:util",
"//ui/webui/resources/js/cr:ui",
"//ui/webui/resources/js/cr/ui:tabs",
] ]
externs_list = chrome_extension_public_externs + externs_list = chrome_extension_public_externs +
[ "$externs_path/networking_private.js" ] [ "$externs_path/networking_private.js" ]
......
...@@ -7,21 +7,8 @@ body { ...@@ -7,21 +7,8 @@ body {
flex-direction: column; flex-direction: column;
} }
div {
margin: 10px 0;
}
#select-div {
display: flex;
height: 100px;
width: 500px;
}
.state-table { .state-table {
border-collapse: collapse; border-collapse: collapse;
}
.state-table tr {
min-width: 800px; min-width: 800px;
} }
...@@ -57,7 +44,3 @@ div { ...@@ -57,7 +44,3 @@ div {
height: 32px; height: 32px;
width: 32px; width: 32px;
} }
network-select {
flex: 1;
}
...@@ -3,127 +3,170 @@ ...@@ -3,127 +3,170 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title id="network">$i18n{titleText}</title> <title>$i18n{titleText}</title>
<link rel="stylesheet" href="chrome://resources/css/tabs.css">
<link rel="stylesheet" href="chrome://resources/css/text_defaults.css"> <link rel="stylesheet" href="chrome://resources/css/text_defaults.css">
<link rel="stylesheet" href="chrome://network/network_ui.css"> <link rel="stylesheet" href="chrome://network/network_ui.css">
<link rel="import" href="chrome://resources/cr_components/chromeos/network/mojo_interface_provider.html"> <link rel="import" href="chrome://resources/cr_components/chromeos/network/mojo_interface_provider.html">
<link rel="import" href="chrome://resources/cr_components/chromeos/network/network_icon.html"> <link rel="import" href="chrome://resources/cr_components/chromeos/network/network_icon.html">
<link rel="import" href="chrome://resources/cr_components/chromeos/network/network_select.html"> <link rel="import" href="chrome://resources/cr_components/chromeos/network/network_select.html">
<link rel="import" href="chrome://resources/cr_components/chromeos/network_health/network_health_summary.html"> <link rel="import" href="chrome://resources/cr_components/chromeos/network_health/network_health_summary.html">
<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html"> <link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html">
<script src="chrome://resources/js/cr.js"></script>
<script src="chrome://resources/js/cr/ui.js"></script>
<script src="chrome://resources/js/cr/ui/tabs.js"></script>
<script src="chrome://resources/js/load_time_data.js"></script> <script src="chrome://resources/js/load_time_data.js"></script>
<script src="chrome://resources/js/util.js"></script> <script src="chrome://resources/js/util.js"></script>
<script src="chrome://network/strings.js"></script> <script src="chrome://network/strings.js"></script>
<script src="chrome://network/network_ui.js"></script>
<style> <style>
tabpanel > div {
margin-bottom: 10px;
}
#global-policy {
white-space: pre-wrap;
}
#cellular-error-text { #cellular-error-text {
color: red; color: red;
} }
#select-div {
display: flex;
height: 400px;
width: 500px;
}
network-select {
flex: 1;
}
</style> </style>
</head> </head>
<body> <body>
<div>$i18n{autoRefreshText}</div>
<span>$i18nRaw{deviceLogLinkText}</span> <tabbox id="network-ui">
<tabs>
<div> <tab>General</tab>
<h2>$i18n{cellularActivationLabel}</h2> <tab>Network Health</tab>
<cr-button class="action-button" id="cellular-activation-button"> <tab>Network Select</tab>
$i18n{cellularActivationButtonText} </tabs>
</cr-button> <tabpanels>
<div id="cellular-error-text" hidden>$i18n{noCellularErrorText}</div> <tabpanel id="general">
</div> <h2>$i18n{titleText}</h2>
<div>$i18n{autoRefreshText}</div>
<div> <span>$i18nRaw{deviceLogLinkText}</span>
<h2>$i18n{addNewWifiLabel}</h2>
<cr-button class="action-button" id="add-new-wifi-button"> <div>
$i18n{addNewWifiButtonText} <h2>$i18n{cellularActivationLabel}</h2>
</cr-button> <cr-button class="action-button" id="cellular-activation-button">
</div> $i18n{cellularActivationButtonText}
</cr-button>
<h2>$i18n{globalPolicyLabel}</h2> <div id="cellular-error-text" hidden>$i18n{noCellularErrorText}</div>
<div id="global-policy"></div> </div>
<div id="select-div"> <div>
<network-select></network-select> <h2>$i18n{addNewWifiLabel}</h2>
</div> <cr-button class="action-button" id="add-new-wifi-button">
<div> $i18n{addNewWifiButtonText}
<cr-button class="action-button" id="refresh"> </cr-button>
$i18n{networkRefreshText} </div>
</cr-button>
</div> <h2>$i18n{globalPolicyLabel}</h2>
<div id="global-policy"></div>
<div>
<h2>$i18n{networkHealthLabel}</h2> <cr-button class="action-button" id="refresh">
<network-health-summary></network-health-summary> $i18n{networkRefreshText}
</cr-button>
<h2>$i18n{networkListsLabel}</h2> </div>
<div>$i18n{clickToExpandText}</div> <h2>$i18n{networkListsLabel}</h2>
<div>
<span>$i18n{propertyFormatText}</span> <div>$i18n{clickToExpandText}</div>
<select id="get-property-format"> <div>
<option value="normal">$i18n{normalFormatOption}</option> <span>$i18n{propertyFormatText}</span>
<option value="managed">$i18n{managedFormatOption}</option> <select id="get-property-format">
<option value="state">$i18n{stateFormatOption}</option> <option value="normal">$i18n{normalFormatOption}</option>
<option value="shill">$i18n{shillFormatOption}</option> <option value="managed">$i18n{managedFormatOption}</option>
</select> <option value="state">$i18n{stateFormatOption}</option>
</div> <option value="shill">$i18n{shillFormatOption}</option>
</select>
<h3>$i18n{devicesLabel}</h3> </div>
<table id="device-state-table" class="state-table">
<tr class="state-table-header"> <h3>$i18n{devicesLabel}</h3>
<td></td> <table id="device-state-table" class="state-table">
<td></td> <tr class="state-table-header">
<td>Type</td> <td></td>
<td>State</td> <td></td>
</tr> <td>Type</td>
</table> <td>State</td>
</tr>
<h3>$i18n{visibleNetworksLabel}</h3> </table>
<table id="network-state-table" class="state-table">
<tr class="state-table-header"> <h3>$i18n{visibleNetworksLabel}</h3>
<td></td> <table id="network-state-table" class="state-table">
<td></td> <tr class="state-table-header">
<td>GUID</td> <td></td>
<td>Name</td> <td></td>
<td>Type</td> <td>GUID</td>
<td>State</td> <td>Name</td>
<td>Connect?</td> <td>Type</td>
<td>Error</td> <td>State</td>
<td>Security</td> <td>Connect?</td>
<td>Tech</td> <td>Error</td>
<td>Activation</td> <td>Security</td>
<td>Roam</td> <td>Tech</td>
<td>Frequency</td> <td>Activation</td>
<td>Strength</td> <td>Roam</td>
</tr> <td>Frequency</td>
</table> <td>Strength</td>
</tr>
<h3>$i18n{ethernetEapNetworkLabel}</h3> </table>
<table id="ethernet-eap-state-table" class="state-table">
<tr class="state-table-header"> <h3>$i18n{ethernetEapNetworkLabel}</h3>
<td></td> <table id="ethernet-eap-state-table" class="state-table">
<td></td> <tr class="state-table-header">
<td>GUID</td> <td></td>
<td>Name</td> <td></td>
<td>Type</td> <td>GUID</td>
<td>ONC Source</td> <td>Name</td>
</tr> <td>Type</td>
</table> <td>ONC Source</td>
</tr>
<h3>$i18n{favoriteNetworksLabel}</h3> </table>
<table id="favorite-state-table" class="state-table">
<tr class="state-table-header"> <h3>$i18n{favoriteNetworksLabel}</h3>
<td></td> <table id="favorite-state-table" class="state-table">
<td></td> <tr class="state-table-header">
<td>GUID</td> <td></td>
<td>Name</td> <td></td>
<td>Type</td> <td>GUID</td>
<td>ONC Source</td> <td>Name</td>
</tr> <td>Type</td>
</table> <td>ONC Source</td>
</tr>
</table>
</tabpanel>
<tabpanel id="health">
<h2>$i18n{networkHealthLabel}</h2>
<network-health-summary></network-health-summary>
</tabpanel>
<tabpanel id="select">
<div id="select-div">
<network-select></network-select>
</div>
</tabpanel>
</tabpanels>
</tabbox>
<script src="network_ui.js"></script>
</body> </body>
</html> </html>
...@@ -5,24 +5,15 @@ ...@@ -5,24 +5,15 @@
/** /**
* @fileoverview Builds UI elements shown in chrome://networks debugging page. * @fileoverview Builds UI elements shown in chrome://networks debugging page.
*/ */
const networkUI = {};
/** @typedef {chromeos.networkConfig.mojom.NetworkStateProperties} */
networkUI.NetworkStateProperties;
/** @typedef {chromeos.networkConfig.mojom.DeviceStateProperties} */
networkUI.DeviceStateProperties;
/** /**
* @typedef {networkUI.NetworkStateProperties|networkUI.DeviceStateProperties} * @typedef {!OncMojo.DeviceStateProperties|!OncMojo.NetworkStateProperties}
*/ */
networkUI.StateProperties; OncMojo.StateProperties;
const NetworkUI = (function() { cr.define('network_ui', function() {
'use strict'; 'use strict';
const mojom = chromeos.networkConfig.mojom;
// Properties to display in the network state table. Each entry can be either // Properties to display in the network state table. Each entry can be either
// a single state field or an array of state fields. If more than one is // a single state field or an array of state fields. If more than one is
// specified then the first non empty value is used. // specified then the first non empty value is used.
...@@ -41,7 +32,7 @@ const NetworkUI = (function() { ...@@ -41,7 +32,7 @@ const NetworkUI = (function() {
* This UI will use both the networkingPrivate extension API and the * This UI will use both the networkingPrivate extension API and the
* networkConfig mojo API until we provide all of the required functionality * networkConfig mojo API until we provide all of the required functionality
* in networkConfig. TODO(stevenjb): Remove use of networkingPrivate api. * in networkConfig. TODO(stevenjb): Remove use of networkingPrivate api.
* @type {?mojom.CrosNetworkConfigRemote} * @type {?chromeos.networkConfig.mojom.CrosNetworkConfigRemote}
*/ */
let networkConfig = null; let networkConfig = null;
...@@ -86,7 +77,7 @@ const NetworkUI = (function() { ...@@ -86,7 +77,7 @@ const NetworkUI = (function() {
* nested property, e.g. 'WiFi.Security'. If any part of a nested key is * nested property, e.g. 'WiFi.Security'. If any part of a nested key is
* missing, this will return undefined. * missing, this will return undefined.
* *
* @param {!networkUI.StateProperties} state * @param {!OncMojo.StateProperties} state
* @param {string} key The ONC key for the property. * @param {string} key The ONC key for the property.
* @return {*} The value associated with the property or undefined if the * @return {*} The value associated with the property or undefined if the
* key (any part of it) is not defined. * key (any part of it) is not defined.
...@@ -107,7 +98,7 @@ const NetworkUI = (function() { ...@@ -107,7 +98,7 @@ const NetworkUI = (function() {
/** /**
* Creates a cell with a button for expanding a network state table row. * Creates a cell with a button for expanding a network state table row.
* *
* @param {!networkUI.StateProperties} state * @param {!OncMojo.StateProperties} state
* @return {!HTMLTableCellElement} The created td element that displays the * @return {!HTMLTableCellElement} The created td element that displays the
* given value. * given value.
*/ */
...@@ -127,7 +118,7 @@ const NetworkUI = (function() { ...@@ -127,7 +118,7 @@ const NetworkUI = (function() {
/** /**
* Creates a cell with an icon representing the network state. * Creates a cell with an icon representing the network state.
* *
* @param {!networkUI.StateProperties} state * @param {!OncMojo.StateProperties} state
* @return {!HTMLTableCellElement} The created td element that displays the * @return {!HTMLTableCellElement} The created td element that displays the
* icon. * icon.
*/ */
...@@ -159,7 +150,7 @@ const NetworkUI = (function() { ...@@ -159,7 +150,7 @@ const NetworkUI = (function() {
* Creates a row in the network state table. * Creates a row in the network state table.
* *
* @param {Array} stateFields The state fields to use for the row. * @param {Array} stateFields The state fields to use for the row.
* @param {!networkUI.StateProperties} state * @param {!OncMojo.StateProperties} state
* @return {!HTMLTableRowElement} The created tr element that contains the * @return {!HTMLTableRowElement} The created tr element that contains the
* network state information. * network state information.
*/ */
...@@ -192,7 +183,7 @@ const NetworkUI = (function() { ...@@ -192,7 +183,7 @@ const NetworkUI = (function() {
* *
* @param {string} tablename The name of the table to be created. * @param {string} tablename The name of the table to be created.
* @param {!Array<string>} stateFields The list of fields for the table. * @param {!Array<string>} stateFields The list of fields for the table.
* @param {!Array<!networkUI.StateProperties>} states * @param {!Array<!OncMojo.StateProperties>} states
*/ */
const createStateTable = function(tablename, stateFields, states) { const createStateTable = function(tablename, stateFields, states) {
const table = $(tablename); const table = $(tablename);
...@@ -226,7 +217,7 @@ const NetworkUI = (function() { ...@@ -226,7 +217,7 @@ const NetworkUI = (function() {
}; };
/** /**
* @param {!mojom.NetworkType} type * @param {!chromeos.networkConfig.mojom.NetworkType} type
* @return {string} A valid HTMLElement id. * @return {string} A valid HTMLElement id.
*/ */
const idFromType = function(type) { const idFromType = function(type) {
...@@ -236,7 +227,7 @@ const NetworkUI = (function() { ...@@ -236,7 +227,7 @@ const NetworkUI = (function() {
/** /**
* This callback function is triggered when visible networks are received. * This callback function is triggered when visible networks are received.
* *
* @param {!Array<!networkUI.NetworkStateProperties>} states * @param {!Array<!OncMojo.NetworkStateProperties>} states
*/ */
const onVisibleNetworksReceived = function(states) { const onVisibleNetworksReceived = function(states) {
createStateTable('network-state-table', NETWORK_STATE_FIELDS, states); createStateTable('network-state-table', NETWORK_STATE_FIELDS, states);
...@@ -245,7 +236,7 @@ const NetworkUI = (function() { ...@@ -245,7 +236,7 @@ const NetworkUI = (function() {
/** /**
* This callback function is triggered when favorite networks are received. * This callback function is triggered when favorite networks are received.
* *
* @param {!Array<!networkUI.NetworkStateProperties>} states * @param {!Array<!OncMojo.NetworkStateProperties>} states
*/ */
const onFavoriteNetworksReceived = function(states) { const onFavoriteNetworksReceived = function(states) {
createStateTable('favorite-state-table', FAVORITE_STATE_FIELDS, states); createStateTable('favorite-state-table', FAVORITE_STATE_FIELDS, states);
...@@ -254,7 +245,7 @@ const NetworkUI = (function() { ...@@ -254,7 +245,7 @@ const NetworkUI = (function() {
/** /**
* This callback function is triggered when device states are received. * This callback function is triggered when device states are received.
* *
* @param {!Array<!networkUI.DeviceStateProperties>} states * @param {!Array<!OncMojo.DeviceStateProperties>} states
*/ */
const onDeviceStatesReceived = function(states) { const onDeviceStatesReceived = function(states) {
createStateTable('device-state-table', DEVICE_STATE_FIELDS, states); createStateTable('device-state-table', DEVICE_STATE_FIELDS, states);
...@@ -271,7 +262,7 @@ const NetworkUI = (function() { ...@@ -271,7 +262,7 @@ const NetworkUI = (function() {
* state information for a row. * state information for a row.
* *
* @param {!HTMLElement} btn The button that was clicked. * @param {!HTMLElement} btn The button that was clicked.
* @param {!networkUI.StateProperties} state * @param {!OncMojo.StateProperties} state
*/ */
const toggleExpandRow = function(btn, state) { const toggleExpandRow = function(btn, state) {
const cell = btn.parentNode; const cell = btn.parentNode;
...@@ -289,7 +280,7 @@ const NetworkUI = (function() { ...@@ -289,7 +280,7 @@ const NetworkUI = (function() {
/** /**
* Creates the expanded row for displaying the complete state as JSON. * Creates the expanded row for displaying the complete state as JSON.
* *
* @param {!networkUI.StateProperties} state * @param {!OncMojo.StateProperties} state
* @param {!HTMLTableRowElement} baseRow The unexpanded row associated with * @param {!HTMLTableRowElement} baseRow The unexpanded row associated with
* the new row. * the new row.
* @return {!HTMLTableRowElement} The created tr element for the expanded row. * @return {!HTMLTableRowElement} The created tr element for the expanded row.
...@@ -358,7 +349,7 @@ const NetworkUI = (function() { ...@@ -358,7 +349,7 @@ const NetworkUI = (function() {
/** /**
* Requests network details and calls showDetail with the result. * Requests network details and calls showDetail with the result.
* @param {!networkUI.StateProperties} state * @param {!OncMojo.StateProperties} state
* @param {string} selectedId * @param {string} selectedId
* @param {!HTMLTableCellElement} detailCell * @param {!HTMLTableCellElement} detailCell
*/ */
...@@ -374,7 +365,7 @@ const NetworkUI = (function() { ...@@ -374,7 +365,7 @@ const NetworkUI = (function() {
/** /**
* @param {!HTMLTableCellElement} detailCell * @param {!HTMLTableCellElement} detailCell
* @param {!networkUI.NetworkStateProperties|!networkUI.DeviceStateProperties| * @param {!OncMojo.NetworkStateProperties|!OncMojo.DeviceStateProperties|
* !chromeos.networkConfig.mojom.ManagedProperties| * !chromeos.networkConfig.mojom.ManagedProperties|
* !chrome.networkingPrivate.NetworkProperties} state * !chrome.networkingPrivate.NetworkProperties} state
* @param {!Object=} error * @param {!Object=} error
...@@ -488,6 +479,7 @@ const NetworkUI = (function() { ...@@ -488,6 +479,7 @@ const NetworkUI = (function() {
* Requests an update of all network info. * Requests an update of all network info.
*/ */
const requestNetworks = function() { const requestNetworks = function() {
const mojom = chromeos.networkConfig.mojom;
networkConfig networkConfig
.getNetworkStateList({ .getNetworkStateList({
filter: mojom.FilterType.kVisible, filter: mojom.FilterType.kVisible,
...@@ -563,7 +555,8 @@ const NetworkUI = (function() { ...@@ -563,7 +555,8 @@ const NetworkUI = (function() {
// Otherwise, connect. // Otherwise, connect.
networkConfig.startConnect(networkState.guid).then(response => { networkConfig.startConnect(networkState.guid).then(response => {
if (response.result == mojom.StartConnectResult.kSuccess) { if (response.result ==
chromeos.networkConfig.mojom.StartConnectResult.kSuccess) {
return; return;
} }
console.error( console.error(
...@@ -573,10 +566,21 @@ const NetworkUI = (function() { ...@@ -573,10 +566,21 @@ const NetworkUI = (function() {
}); });
}; };
const selectTabFromHash = function() {
const selectedTab = window.location.hash.substring(1);
if (!selectedTab)
return;
const tabpanel = document.querySelector('tabpanels > #' + selectedTab);
if (tabpanel) {
tabpanel.selected = true;
}
};
/** /**
* Gets network information from WebUI and sets custom items. * Gets network information from WebUI and sets custom items.
*/ */
document.addEventListener('DOMContentLoaded', function() { function onLoad() {
cr.ui.decorate('tabbox', cr.ui.TabBox);
const select = document.querySelector('network-select'); const select = document.querySelector('network-select');
select.customItems = [ select.customItems = [
{customItemName: 'Add WiFi', polymerIcon: 'cr:add', customData: 'WiFi'}, {customItemName: 'Add WiFi', polymerIcon: 'cr:add', customData: 'WiFi'},
...@@ -587,19 +591,28 @@ const NetworkUI = (function() { ...@@ -587,19 +591,28 @@ const NetworkUI = (function() {
$('add-new-wifi-button').onclick = showAddNewWifi; $('add-new-wifi-button').onclick = showAddNewWifi;
$('refresh').onclick = requestNetworks; $('refresh').onclick = requestNetworks;
$('get-property-format').onchange = requestNetworks; $('get-property-format').onchange = requestNetworks;
document.addEventListener('custom-item-selected', function(event) {
chrome.send('addNetwork', [event.detail.customData]);
});
window.addEventListener('hashchange', function(event) {
selectTabFromHash();
});
selectTabFromHash();
init(); init();
requestNetworks(); requestNetworks();
requestGlobalPolicy(); requestGlobalPolicy();
}); }
document.addEventListener('custom-item-selected', function(event) {
chrome.send('addNetwork', [event.detail.customData]);
});
return { return {
getShillNetworkPropertiesResult: getShillNetworkPropertiesResult, getShillNetworkPropertiesResult: getShillNetworkPropertiesResult,
getShillDevicePropertiesResult: getShillDevicePropertiesResult, getShillDevicePropertiesResult: getShillDevicePropertiesResult,
getShillEthernetEAPResult: getShillEthernetEAPResult, getShillEthernetEAPResult: getShillEthernetEAPResult,
openCellularActivationUiResult: openCellularActivationUiResult openCellularActivationUiResult: openCellularActivationUiResult,
onLoad: onLoad
}; };
})(); });
document.addEventListener('DOMContentLoaded', network_ui.onLoad);
...@@ -173,7 +173,7 @@ class NetworkConfigMessageHandler : public content::WebUIMessageHandler { ...@@ -173,7 +173,7 @@ class NetworkConfigMessageHandler : public content::WebUIMessageHandler {
AllowJavascript(); AllowJavascript();
CallJavascriptFunction( CallJavascriptFunction(
base::StringPrintf("NetworkUI.%sResult", kGetNetworkProperties), base::StringPrintf("network_ui.%sResult", kGetNetworkProperties),
return_arg_list); return_arg_list);
} }
...@@ -210,7 +210,7 @@ class NetworkConfigMessageHandler : public content::WebUIMessageHandler { ...@@ -210,7 +210,7 @@ class NetworkConfigMessageHandler : public content::WebUIMessageHandler {
AllowJavascript(); AllowJavascript();
if (list.empty()) { if (list.empty()) {
CallJavascriptFunction( CallJavascriptFunction(
base::StringPrintf("NetworkUI.%sResult", kGetEthernetEAP)); base::StringPrintf("network_ui.%sResult", kGetEthernetEAP));
return; return;
} }
const NetworkState* eap = list.front(); const NetworkState* eap = list.front();
...@@ -219,7 +219,7 @@ class NetworkConfigMessageHandler : public content::WebUIMessageHandler { ...@@ -219,7 +219,7 @@ class NetworkConfigMessageHandler : public content::WebUIMessageHandler {
properties.SetStringKey("name", eap->name()); properties.SetStringKey("name", eap->name());
properties.SetStringKey("type", eap->type()); properties.SetStringKey("type", eap->type());
CallJavascriptFunction( CallJavascriptFunction(
base::StringPrintf("NetworkUI.%sResult", kGetEthernetEAP), properties); base::StringPrintf("network_ui.%sResult", kGetEthernetEAP), properties);
} }
void OpenCellularActivationUi(const base::ListValue* arg_list) { void OpenCellularActivationUi(const base::ListValue* arg_list) {
...@@ -231,7 +231,7 @@ class NetworkConfigMessageHandler : public content::WebUIMessageHandler { ...@@ -231,7 +231,7 @@ class NetworkConfigMessageHandler : public content::WebUIMessageHandler {
AllowJavascript(); AllowJavascript();
CallJavascriptFunction( CallJavascriptFunction(
base::StringPrintf("NetworkUI.%sResult", kOpenCellularActivationUi), base::StringPrintf("network_ui.%sResult", kOpenCellularActivationUi),
base::Value(cellular_network != nullptr)); base::Value(cellular_network != nullptr));
} }
...@@ -273,7 +273,7 @@ class NetworkConfigMessageHandler : public content::WebUIMessageHandler { ...@@ -273,7 +273,7 @@ class NetworkConfigMessageHandler : public content::WebUIMessageHandler {
AllowJavascript(); AllowJavascript();
CallJavascriptFunction( CallJavascriptFunction(
base::StringPrintf("NetworkUI.%sResult", kGetDeviceProperties), base::StringPrintf("network_ui.%sResult", kGetDeviceProperties),
return_arg_list); return_arg_list);
} }
...@@ -293,7 +293,7 @@ class NetworkConfigMessageHandler : public content::WebUIMessageHandler { ...@@ -293,7 +293,7 @@ class NetworkConfigMessageHandler : public content::WebUIMessageHandler {
AllowJavascript(); AllowJavascript();
CallJavascriptFunction( CallJavascriptFunction(
base::StringPrintf("NetworkUI.%sResult", function_name.c_str()), base::StringPrintf("network_ui.%sResult", function_name.c_str()),
return_arg_list); return_arg_list);
} }
...@@ -315,8 +315,6 @@ void NetworkUI::GetLocalizedStrings(base::DictionaryValue* localized_strings) { ...@@ -315,8 +315,6 @@ void NetworkUI::GetLocalizedStrings(base::DictionaryValue* localized_strings) {
localized_strings->SetString("titleText", localized_strings->SetString("titleText",
l10n_util::GetStringUTF16(IDS_NETWORK_UI_TITLE)); l10n_util::GetStringUTF16(IDS_NETWORK_UI_TITLE));
localized_strings->SetString("titleText",
l10n_util::GetStringUTF16(IDS_NETWORK_UI_TITLE));
localized_strings->SetString( localized_strings->SetString(
"autoRefreshText", "autoRefreshText",
l10n_util::GetStringUTF16(IDS_NETWORK_UI_AUTO_REFRESH)); l10n_util::GetStringUTF16(IDS_NETWORK_UI_AUTO_REFRESH));
......
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