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.internet', function() { | 5 cr.define('options.internet', function() { |
6 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
7 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; | 7 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
8 | 8 |
9 /** | 9 /** |
10 * Network settings constants. These enums must match their C++ | 10 * Network settings constants. These enums must match their C++ |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 updateHidden('#details-internet-page .plan-details-info', | 366 updateHidden('#details-internet-page .plan-details-info', |
367 !this.cellular || this.nocellplan || this.cellplanloading); | 367 !this.cellular || this.nocellplan || this.cellplanloading); |
368 updateHidden('#details-internet-page .gsm-only', | 368 updateHidden('#details-internet-page .gsm-only', |
369 !this.cellular || !this.gsm); | 369 !this.cellular || !this.gsm); |
370 updateHidden('#details-internet-page .cdma-only', | 370 updateHidden('#details-internet-page .cdma-only', |
371 !this.cellular || this.gsm); | 371 !this.cellular || this.gsm); |
372 updateHidden('#details-internet-page .apn-list-view', | 372 updateHidden('#details-internet-page .apn-list-view', |
373 !this.cellular || !this.gsm); | 373 !this.cellular || !this.gsm); |
374 updateHidden('#details-internet-page .apn-details-view', true); | 374 updateHidden('#details-internet-page .apn-details-view', true); |
375 | 375 |
376 // Password and shared. | 376 // Wifi - Password and shared. |
377 updateHidden('#details-internet-page #password-details', | 377 updateHidden('#details-internet-page #password-details', |
378 !this.wireless || !this.password); | 378 !this.wireless || !this.password); |
379 updateHidden('#details-internet-page #shared-network', !this.shared); | 379 updateHidden('#details-internet-page #wifi-shared-network', |
| 380 !this.shared); |
380 updateHidden('#details-internet-page #prefer-network', | 381 updateHidden('#details-internet-page #prefer-network', |
381 !this.showPreferred); | 382 !this.showPreferred); |
382 | 383 |
| 384 // WiMAX. |
| 385 updateHidden('#details-internet-page #wimax-shared-network', |
| 386 !this.shared); |
| 387 |
383 // Proxy | 388 // Proxy |
384 this.updateProxyBannerVisibility_(); | 389 this.updateProxyBannerVisibility_(); |
385 this.toggleSingleProxy_(); | 390 this.toggleSingleProxy_(); |
386 if ($('manual-proxy').checked) | 391 if ($('manual-proxy').checked) |
387 this.enableManualProxy_(); | 392 this.enableManualProxy_(); |
388 else | 393 else |
389 this.disableManualProxy_(); | 394 this.disableManualProxy_(); |
390 if (!this.proxyListInitialized_ && this.visible) { | 395 if (!this.proxyListInitialized_ && this.visible) { |
391 this.proxyListInitialized_ = true; | 396 this.proxyListInitialized_ = true; |
392 $('ignored-host-list').redraw(); | 397 $('ignored-host-list').redraw(); |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 DetailsInternetPage.setDetails = function() { | 573 DetailsInternetPage.setDetails = function() { |
569 var data = $('connection-state').data; | 574 var data = $('connection-state').data; |
570 var servicePath = data.servicePath; | 575 var servicePath = data.servicePath; |
571 if (data.type == Constants.TYPE_WIFI) { | 576 if (data.type == Constants.TYPE_WIFI) { |
572 chrome.send('setPreferNetwork', | 577 chrome.send('setPreferNetwork', |
573 [String(servicePath), | 578 [String(servicePath), |
574 $('prefer-network-wifi').checked ? 'true' : 'false']); | 579 $('prefer-network-wifi').checked ? 'true' : 'false']); |
575 chrome.send('setAutoConnect', | 580 chrome.send('setAutoConnect', |
576 [String(servicePath), | 581 [String(servicePath), |
577 $('auto-connect-network-wifi').checked ? 'true' : 'false']); | 582 $('auto-connect-network-wifi').checked ? 'true' : 'false']); |
| 583 } else if (data.type == Constants.TYPE_WIMAX) { |
| 584 chrome.send('setAutoConnect', |
| 585 [String(servicePath), |
| 586 $('auto-connect-network-wimax').checked ? 'true' : 'false']); |
578 } else if (data.type == Constants.TYPE_CELLULAR) { | 587 } else if (data.type == Constants.TYPE_CELLULAR) { |
579 chrome.send('setAutoConnect', | 588 chrome.send('setAutoConnect', |
580 [String(servicePath), | 589 [String(servicePath), |
581 $('auto-connect-network-cellular').checked ? 'true' : | 590 $('auto-connect-network-cellular').checked ? 'true' : |
582 'false']); | 591 'false']); |
583 } | 592 } |
584 var ipConfigList = $('ip-config-list'); | 593 var ipConfigList = $('ip-config-list'); |
585 chrome.send('setIPConfig', [String(servicePath), | 594 chrome.send('setIPConfig', [String(servicePath), |
586 $('ip-type-dhcp').checked ? 'true' : 'false', | 595 $('ip-type-dhcp').checked ? 'true' : 'false', |
587 ipConfigList.dataModel.item(0).value, | 596 ipConfigList.dataModel.item(0).value, |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 } else if (data.type == Constants.TYPE_WIMAX) { | 791 } else if (data.type == Constants.TYPE_WIMAX) { |
783 OptionsPage.showTab($('wimax-network-nav-tab')); | 792 OptionsPage.showTab($('wimax-network-nav-tab')); |
784 detailsPage.wimax = true; | 793 detailsPage.wimax = true; |
785 detailsPage.wireless = false; | 794 detailsPage.wireless = false; |
786 detailsPage.vpn = false; | 795 detailsPage.vpn = false; |
787 detailsPage.ethernet = false; | 796 detailsPage.ethernet = false; |
788 detailsPage.cellular = false; | 797 detailsPage.cellular = false; |
789 detailsPage.gsm = false; | 798 detailsPage.gsm = false; |
790 detailsPage.shared = data.shared; | 799 detailsPage.shared = data.shared; |
791 detailsPage.showPreferred = data.showPreferred; | 800 detailsPage.showPreferred = data.showPreferred; |
792 $('prefer-network-wimax').checked = data.preferred.value; | 801 $('wimax-connection-state').textContent = data.connectionState; |
793 $('prefer-network-wimax').disabled = !data.remembered; | |
794 $('auto-connect-network-wimax').checked = data.autoConnect.value; | 802 $('auto-connect-network-wimax').checked = data.autoConnect.value; |
795 $('auto-connect-network-wimax').disabled = !data.remembered; | 803 $('auto-connect-network-wimax').disabled = !data.remembered; |
796 if (data.identity) { | 804 if (data.identity) { |
797 $('wimax-eap-identity').textContent = data.identity; | 805 $('wimax-eap-identity').textContent = data.identity; |
798 $('wimax-eap-identity-entry').hidden = false; | 806 $('wimax-eap-identity-entry').hidden = false; |
799 } else { | 807 } else { |
800 $('wimax-eap-identity-entry').hidden = true; | 808 $('wimax-eap-identity-entry').hidden = true; |
801 } | 809 } |
802 // Signal strength as percentage. | 810 // Signal strength as percentage. |
803 var signalStrength = loadTimeData.getString('inetSignalStrengthFormat'); | 811 var signalStrength = loadTimeData.getString('inetSignalStrengthFormat'); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 | 952 |
945 // Don't show page name in address bar and in history to prevent people | 953 // Don't show page name in address bar and in history to prevent people |
946 // navigate here by hand and solve issue with page session restore. | 954 // navigate here by hand and solve issue with page session restore. |
947 OptionsPage.showPageByName('detailsInternetPage', false); | 955 OptionsPage.showPageByName('detailsInternetPage', false); |
948 }; | 956 }; |
949 | 957 |
950 return { | 958 return { |
951 DetailsInternetPage: DetailsInternetPage | 959 DetailsInternetPage: DetailsInternetPage |
952 }; | 960 }; |
953 }); | 961 }); |
OLD | NEW |