| 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 /** | 5 /** |
| 6 * Partial definition of the result of networkingPrivate.getProperties()). | 6 * Partial definition of the result of networkingPrivate.getProperties()). |
| 7 * TODO(stevenjb): Replace with chrome.networkingPrivate.NetworkStateProperties | 7 * TODO(stevenjb): Replace with chrome.networkingPrivate.NetworkStateProperties |
| 8 * once that is fully speced. | 8 * once that is fully speced. |
| 9 * @typedef {{ | 9 * @typedef {{ |
| 10 * ConnectionState: string, | 10 * ConnectionState: string, |
| (...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 if (isManaged(this.data.Source)) | 837 if (isManaged(this.data.Source)) |
| 838 this.showManagedNetworkIndicator(); | 838 this.showManagedNetworkIndicator(); |
| 839 }, | 839 }, |
| 840 }; | 840 }; |
| 841 | 841 |
| 842 /** | 842 /** |
| 843 * Adds a command to a menu for modifying network settings. | 843 * Adds a command to a menu for modifying network settings. |
| 844 * @param {!Element} menu Parent menu. | 844 * @param {!Element} menu Parent menu. |
| 845 * @param {?NetworkProperties} data Description of the network. | 845 * @param {?NetworkProperties} data Description of the network. |
| 846 * @param {!string} label Display name for the menu item. | 846 * @param {!string} label Display name for the menu item. |
| 847 * @param {!Function} command Callback function. | 847 * @param {Function} command Callback function. |
| 848 * @return {!Element} The created menu item. | 848 * @return {!Element} The created menu item. |
| 849 * @private | 849 * @private |
| 850 */ | 850 */ |
| 851 function createCallback_(menu, data, label, command) { | 851 function createCallback_(menu, data, label, command) { |
| 852 var button = menu.ownerDocument.createElement('div'); | 852 var button = menu.ownerDocument.createElement('div'); |
| 853 button.className = 'network-menu-item'; | 853 button.className = 'network-menu-item'; |
| 854 | 854 |
| 855 var buttonIconDiv = menu.ownerDocument.createElement('div'); | 855 var buttonIconDiv = menu.ownerDocument.createElement('div'); |
| 856 buttonIconDiv.className = 'network-icon'; | 856 buttonIconDiv.className = 'network-icon'; |
| 857 button.appendChild(buttonIconDiv); | 857 button.appendChild(buttonIconDiv); |
| (...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1554 command: createVPNConnectionCallback_(), | 1554 command: createVPNConnectionCallback_(), |
| 1555 data: {} | 1555 data: {} |
| 1556 }); | 1556 }); |
| 1557 return entries; | 1557 return entries; |
| 1558 } | 1558 } |
| 1559 | 1559 |
| 1560 /** | 1560 /** |
| 1561 * Return whether connecting to or viewing unmanaged networks is allowed. | 1561 * Return whether connecting to or viewing unmanaged networks is allowed. |
| 1562 * @private | 1562 * @private |
| 1563 */ | 1563 */ |
| 1564 function allowUnmanagedNetworks_(item) { | 1564 function allowUnmanagedNetworks_() { |
| 1565 if (loadTimeData.valueExists('allowOnlyPolicyNetworksToConnect') && | 1565 if (loadTimeData.valueExists('allowOnlyPolicyNetworksToConnect') && |
| 1566 loadTimeData.getBoolean('allowOnlyPolicyNetworksToConnect')) { | 1566 loadTimeData.getBoolean('allowOnlyPolicyNetworksToConnect')) { |
| 1567 return false; | 1567 return false; |
| 1568 } | 1568 } |
| 1569 return true; | 1569 return true; |
| 1570 } | 1570 } |
| 1571 | 1571 |
| 1572 /** | 1572 /** |
| 1573 * Whether the Network list is disabled. Only used for display purpose. | 1573 * Whether the Network list is disabled. Only used for display purpose. |
| 1574 */ | 1574 */ |
| 1575 cr.defineProperty(NetworkList, 'disabled', cr.PropertyKind.BOOL_ATTR); | 1575 cr.defineProperty(NetworkList, 'disabled', cr.PropertyKind.BOOL_ATTR); |
| 1576 | 1576 |
| 1577 // Export | 1577 // Export |
| 1578 return { | 1578 return { |
| 1579 NetworkList: NetworkList | 1579 NetworkList: NetworkList |
| 1580 }; | 1580 }; |
| 1581 }); | 1581 }); |
| OLD | NEW |