OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 cr.define('options.network', function() { | 5 cr.define('options.network', function() { |
6 | 6 |
7 var ArrayDataModel = cr.ui.ArrayDataModel; | 7 var ArrayDataModel = cr.ui.ArrayDataModel; |
8 var List = cr.ui.List; | 8 var List = cr.ui.List; |
9 var ListItem = cr.ui.ListItem; | 9 var ListItem = cr.ui.ListItem; |
10 var Menu = cr.ui.Menu; | 10 var Menu = cr.ui.Menu; |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 | 579 |
580 /** | 580 /** |
581 * Adds a menu item for connecting to a network. | 581 * Adds a menu item for connecting to a network. |
582 * @param {!Element} menu Parent menu. | 582 * @param {!Element} menu Parent menu. |
583 * @param {Object} data Description of the network. | 583 * @param {Object} data Description of the network. |
584 * @param {string=} opt_connect Optional connection method. | 584 * @param {string=} opt_connect Optional connection method. |
585 * @private | 585 * @private |
586 */ | 586 */ |
587 createConnectCallback_: function(menu, data, opt_connect) { | 587 createConnectCallback_: function(menu, data, opt_connect) { |
588 var cmd = opt_connect ? opt_connect : 'connect'; | 588 var cmd = opt_connect ? opt_connect : 'connect'; |
| 589 var label = data.networkName; |
| 590 if (cmd == 'activate') { |
| 591 label = localStrings.getString('activateNetwork'); |
| 592 label = label.replace('$1', data.networkName); |
| 593 } |
589 var menuItem = this.createCallback_(menu, | 594 var menuItem = this.createCallback_(menu, |
590 data, | 595 data, |
591 data.networkName, | 596 label, |
592 cmd); | 597 cmd); |
593 menuItem.style.backgroundImage = url(data.iconURL); | 598 menuItem.style.backgroundImage = url(data.iconURL); |
594 | 599 |
595 if (data.policyManaged) | 600 if (data.policyManaged) |
596 menuItem.appendChild(new ManagedNetworkIndicator()); | 601 menuItem.appendChild(new ManagedNetworkIndicator()); |
597 | 602 |
598 var optionsButton = this.ownerDocument.createElement('div'); | 603 var optionsButton = this.ownerDocument.createElement('div'); |
599 optionsButton.className = 'network-options-button'; | 604 optionsButton.className = 'network-options-button'; |
600 var type = String(data.networkType); | 605 var type = String(data.networkType); |
601 var path = data.servicePath; | 606 var path = data.servicePath; |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 * Whether the Network list is disabled. Only used for display purpose. | 992 * Whether the Network list is disabled. Only used for display purpose. |
988 * @type {boolean} | 993 * @type {boolean} |
989 */ | 994 */ |
990 cr.defineProperty(NetworkList, 'disabled', cr.PropertyKind.BOOL_ATTR); | 995 cr.defineProperty(NetworkList, 'disabled', cr.PropertyKind.BOOL_ATTR); |
991 | 996 |
992 // Export | 997 // Export |
993 return { | 998 return { |
994 NetworkList: NetworkList | 999 NetworkList: NetworkList |
995 }; | 1000 }; |
996 }); | 1001 }); |
OLD | NEW |