Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2149)

Unified Diff: chrome/browser/resources/options/chromeos/network_list.js

Issue 673313003: More changes to make network settings better match extension API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Append -> Add Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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]);
};
}

Powered by Google App Engine
This is Rietveld 408576698