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 70cc49c6a416f5439040a67c5af824955e30a38c..a9fdca296ec027823dd805041fab5881fa9b3173 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. |
*/ |
@@ -689,10 +699,14 @@ cr.define('options.network', function() { |
* @private |
*/ |
createNetworkOptionsCallback_: function(parent, data) { |
+ var servicePath = data.servicePath; |
+ var showDetailsCallback = function() { |
+ showDetails(servicePath); |
+ }; |
var menuItem = createCallback_(parent, |
data, |
getNetworkName(data), |
- 'showDetails', |
+ showDetailsCallback, |
pneubeck (no reviews)
2014/10/27 16:37:19
showDetails.bind(null, data.servicePath);
is IMO
stevenjb
2014/10/27 17:32:33
Done.
|
data.iconURL); |
if (data.policyManaged) |
menuItem.appendChild(new ManagedNetworkIndicator()); |
@@ -744,8 +758,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 |
@@ -765,14 +778,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); |
@@ -1021,7 +1027,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', |
@@ -1222,7 +1228,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]); |
}; |
} |