| 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 // require: onc_data.js | 5 // require: onc_data.js |
| 6 | 6 |
| 7 // NOTE(stevenjb): This code is in the process of being converted to be | 7 // NOTE(stevenjb): This code is in the process of being converted to be |
| 8 // compatible with the networkingPrivate extension API: | 8 // compatible with the networkingPrivate extension API: |
| 9 // * The network property dictionaries are being converted to use ONC values. | 9 // * The network property dictionaries are being converted to use ONC values. |
| 10 // * chrome.send calls will be replaced with chrome.networkingPrivate calls. | 10 // * chrome.send calls will be replaced with chrome.networkingPrivate calls. |
| (...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 $('auto-proxy-parms').hidden = !$('auto-proxy').checked; | 717 $('auto-proxy-parms').hidden = !$('auto-proxy').checked; |
| 718 $('manual-proxy-parms').hidden = !$('manual-proxy').checked; | 718 $('manual-proxy-parms').hidden = !$('manual-proxy').checked; |
| 719 sendChromeMetricsAction('Options_NetworkManualProxy_Enable'); | 719 sendChromeMetricsAction('Options_NetworkManualProxy_Enable'); |
| 720 }, | 720 }, |
| 721 | 721 |
| 722 /** | 722 /** |
| 723 * Helper method called from initializeDetailsPage and updateConnectionData. | 723 * Helper method called from initializeDetailsPage and updateConnectionData. |
| 724 * Updates visibility/enabled of the login/disconnect/configure buttons. | 724 * Updates visibility/enabled of the login/disconnect/configure buttons. |
| 725 * @private | 725 * @private |
| 726 */ | 726 */ |
| 727 updateConnectionButtonVisibilty_: function() { | 727 updateConnectionButtonVisibility_: function() { |
| 728 var onc = this.onc_; | 728 var onc = this.onc_; |
| 729 if (this.type_ == 'Ethernet') { | 729 if (this.type_ == 'Ethernet') { |
| 730 // Ethernet can never be connected or disconnected and can always be | 730 // Ethernet can never be connected or disconnected and can always be |
| 731 // configured (e.g. to set security). | 731 // configured (e.g. to set security). |
| 732 $('details-internet-login').hidden = true; | 732 $('details-internet-login').hidden = true; |
| 733 $('details-internet-disconnect').hidden = true; | 733 $('details-internet-disconnect').hidden = true; |
| 734 $('details-internet-configure').hidden = false; | 734 $('details-internet-configure').hidden = false; |
| 735 return; | 735 return; |
| 736 } | 736 } |
| 737 | 737 |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1378 if (!detailsPage.visible) | 1378 if (!detailsPage.visible) |
| 1379 return; | 1379 return; |
| 1380 | 1380 |
| 1381 if (oncData.GUID != detailsPage.onc_.guid()) | 1381 if (oncData.GUID != detailsPage.onc_.guid()) |
| 1382 return; | 1382 return; |
| 1383 | 1383 |
| 1384 // Update our cached data object. | 1384 // Update our cached data object. |
| 1385 detailsPage.onc_ = new OncData(oncData); | 1385 detailsPage.onc_ = new OncData(oncData); |
| 1386 | 1386 |
| 1387 detailsPage.populateHeader_(); | 1387 detailsPage.populateHeader_(); |
| 1388 detailsPage.updateConnectionButtonVisibilty_(); | 1388 detailsPage.updateConnectionButtonVisibility_(); |
| 1389 detailsPage.updateDetails_(); | 1389 detailsPage.updateDetails_(); |
| 1390 }; | 1390 }; |
| 1391 | 1391 |
| 1392 /** | 1392 /** |
| 1393 * Initializes the details page with the provided ONC data. | 1393 * Initializes the details page with the provided ONC data. |
| 1394 * @param {Object} oncData Dictionary of ONC properties. | 1394 * @param {Object} oncData Dictionary of ONC properties. |
| 1395 */ | 1395 */ |
| 1396 DetailsInternetPage.initializeDetailsPage = function(oncData) { | 1396 DetailsInternetPage.initializeDetailsPage = function(oncData) { |
| 1397 var onc = new OncData(oncData); | 1397 var onc = new OncData(oncData); |
| 1398 | 1398 |
| 1399 var detailsPage = DetailsInternetPage.getInstance(); | 1399 var detailsPage = DetailsInternetPage.getInstance(); |
| 1400 detailsPage.onc_ = onc; | 1400 detailsPage.onc_ = onc; |
| 1401 var type = onc.getActiveValue('Type'); | 1401 var type = onc.getActiveValue('Type'); |
| 1402 detailsPage.type_ = type; | 1402 detailsPage.type_ = type; |
| 1403 | 1403 |
| 1404 sendShowDetailsMetrics(type, onc.getActiveValue('ConnectionState')); | 1404 sendShowDetailsMetrics(type, onc.getActiveValue('ConnectionState')); |
| 1405 | 1405 |
| 1406 detailsPage.populateHeader_(); | 1406 detailsPage.populateHeader_(); |
| 1407 detailsPage.updateConnectionButtonVisibilty_(); | 1407 detailsPage.updateConnectionButtonVisibility_(); |
| 1408 detailsPage.updateDetails_(); | 1408 detailsPage.updateDetails_(); |
| 1409 | 1409 |
| 1410 // TODO(stevenjb): Some of the setup below should be moved to | 1410 // TODO(stevenjb): Some of the setup below should be moved to |
| 1411 // updateDetails_() so that updates are reflected in the UI. | 1411 // updateDetails_() so that updates are reflected in the UI. |
| 1412 | 1412 |
| 1413 // Only show proxy for remembered networks. | 1413 // Only show proxy for remembered networks. |
| 1414 var remembered = onc.getSource() != 'None'; | 1414 var remembered = onc.getSource() != 'None'; |
| 1415 if (remembered) { | 1415 if (remembered) { |
| 1416 detailsPage.showProxy_ = true; | 1416 detailsPage.showProxy_ = true; |
| 1417 // Inform Chrome which network to use for proxy configuration. | 1417 // Inform Chrome which network to use for proxy configuration. |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1784 | 1784 |
| 1785 // Don't show page name in address bar and in history to prevent people | 1785 // Don't show page name in address bar and in history to prevent people |
| 1786 // navigate here by hand and solve issue with page session restore. | 1786 // navigate here by hand and solve issue with page session restore. |
| 1787 PageManager.showPageByName('detailsInternetPage', false); | 1787 PageManager.showPageByName('detailsInternetPage', false); |
| 1788 }; | 1788 }; |
| 1789 | 1789 |
| 1790 return { | 1790 return { |
| 1791 DetailsInternetPage: DetailsInternetPage | 1791 DetailsInternetPage: DetailsInternetPage |
| 1792 }; | 1792 }; |
| 1793 }); | 1793 }); |
| OLD | NEW |