Index: chrome/browser/resources/options/chromeos/network_list.js |
diff --git a/chrome/browser/resources/options/chromeos/network_list.js b/chrome/browser/resources/options/chromeos/network_list.js |
index 90b1d1757302c6fd1f0f37b2a9f55f43d206ff9d..4c65b3427177a1b81d4df9537aeda7c4badbcb6d 100644 |
--- a/chrome/browser/resources/options/chromeos/network_list.js |
+++ b/chrome/browser/resources/options/chromeos/network_list.js |
@@ -149,6 +149,16 @@ cr.define('options.network', function() { |
} |
/** |
+ * @param {string} servicePath The network service path. |
+ */ |
+ function showDetails(servicePath) { |
+ // TODO(stevenjb): chrome.networkingPrivate.getManagedProperties |
+ // (Note: we will need to provide DetailsInternetPage.initializeDetailsPage |
+ // as the callback). |
+ chrome.send('getManagedProperties', [servicePath]); |
+ } |
+ |
+ /** |
* Decorate an element as a NetworkListItem. |
* @param {!Element} el The element to decorate. |
*/ |
@@ -701,10 +711,11 @@ cr.define('options.network', function() { |
* @private |
*/ |
createNetworkOptionsCallback_: function(parent, data) { |
+ var servicePath = data.servicePath; |
var menuItem = createCallback_(parent, |
data, |
getNetworkName(data), |
- 'showDetails', |
+ showDetails.bind(null, servicePath), |
data.iconURL); |
if (data.policyManaged) |
menuItem.appendChild(new ManagedNetworkIndicator()); |
@@ -756,8 +767,7 @@ cr.define('options.network', function() { |
* @param {!Element} menu Parent menu. |
* @param {Object} data Description of the network. |
* @param {!string} label Display name for the menu item. |
- * @param {?(string|!Function)} command Callback function or name |
- * of the command for |networkCommand|. |
+ * @param {!Function} command Callback function. |
* @param {string=} opt_iconURL Optional URL to an icon for the menu item. |
* @return {!Element} The created menu item. |
* @private |
@@ -777,14 +787,7 @@ cr.define('options.network', function() { |
buttonLabel.textContent = label; |
button.appendChild(buttonLabel); |
var callback = null; |
- if (typeof command == 'string') { |
- var type = data.Type; |
- var path = data.servicePath; |
- callback = function() { |
- chrome.send('networkCommand', [type, path, command]); |
- closeMenu_(); |
- }; |
- } else if (command != null) { |
+ if (command != null) { |
if (data) { |
callback = function() { |
(/** @type {Function} */(command))(data); |
@@ -1033,7 +1036,7 @@ cr.define('options.network', function() { |
var type = String('Ethernet'); |
var path = ethernetConnection.servicePath; |
var ethernetOptions = function() { |
- chrome.send('networkCommand', [type, path, 'showDetails']); |
+ showDetails(path); |
}; |
networkList.update( |
{ key: 'Ethernet', |
@@ -1234,7 +1237,7 @@ cr.define('options.network', function() { |
sendChromeMetricsAction('Options_NetworkJoinOtherWifi'); |
else if (type == 'VPN') |
sendChromeMetricsAction('Options_NetworkJoinOtherVPN'); |
- chrome.send('networkCommand', [type, '', 'add']); |
+ chrome.send('addConnection', [type]); |
}; |
} |