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 /** @const */ var IPAddressField = options.internet.IPAddressField; | 8 /** @const */ var IPAddressField = options.internet.IPAddressField; |
9 | 9 |
10 /** | 10 /** |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 detailsPage.wireless = false; | 515 detailsPage.wireless = false; |
516 detailsPage.vpn = false; | 516 detailsPage.vpn = false; |
517 detailsPage.showProxy = true; | 517 detailsPage.showProxy = true; |
518 updateHidden('#internet-tab', true); | 518 updateHidden('#internet-tab', true); |
519 updateHidden('#details-tab-strip', true); | 519 updateHidden('#details-tab-strip', true); |
520 updateHidden('#details-internet-page .action-area', true); | 520 updateHidden('#details-internet-page .action-area', true); |
521 detailsPage.updateControls(); | 521 detailsPage.updateControls(); |
522 detailsPage.visible = true; | 522 detailsPage.visible = true; |
523 }; | 523 }; |
524 | 524 |
| 525 DetailsInternetPage.updateProxySettings = function(type) { |
| 526 var proxyHost = null, |
| 527 proxyPort = null; |
| 528 |
| 529 if (type == 'cros.session.proxy.singlehttp') { |
| 530 proxyHost = 'proxy-host-signal-name'; |
| 531 proxyPort = 'proxy-host-single-port'; |
| 532 }else if (type == 'cros.session.proxy.httpurl') { |
| 533 proxyHost = 'proxy-host-name'; |
| 534 proxyPort = 'proxy-host-port'; |
| 535 }else if (type == 'cros.session.proxy.httpsurl') { |
| 536 proxyHost = 'secure-proxy-host-name'; |
| 537 proxyPort = 'secure-proxy-port'; |
| 538 }else if (type == 'cros.session.proxy.ftpurl') { |
| 539 proxyHost = 'ftp-proxy'; |
| 540 proxyPort = 'ftp-proxy-port'; |
| 541 }else if (type == 'cros.session.proxy.socks') { |
| 542 proxyHost = 'socks-host'; |
| 543 proxyPort = 'socks-port'; |
| 544 }else { |
| 545 return; |
| 546 } |
| 547 |
| 548 var hostValue = $(proxyHost).value; |
| 549 if (hostValue.indexOf(':') !== -1) { |
| 550 if (hostValue.match(/:/g).length == 1) { |
| 551 hostValue = hostValue.split(':'); |
| 552 $(proxyHost).value = hostValue[0]; |
| 553 $(proxyPort).value = hostValue[1]; |
| 554 } |
| 555 } |
| 556 }; |
| 557 |
525 DetailsInternetPage.updateCarrier = function(carrier) { | 558 DetailsInternetPage.updateCarrier = function(carrier) { |
526 DetailsInternetPage.showCarrierChangeSpinner(false); | 559 DetailsInternetPage.showCarrierChangeSpinner(false); |
527 }; | 560 }; |
528 | 561 |
529 DetailsInternetPage.updateSecurityTab = function(requirePin) { | 562 DetailsInternetPage.updateSecurityTab = function(requirePin) { |
530 $('sim-card-lock-enabled').checked = requirePin; | 563 $('sim-card-lock-enabled').checked = requirePin; |
531 $('change-pin').hidden = !requirePin; | 564 $('change-pin').hidden = !requirePin; |
532 }; | 565 }; |
533 | 566 |
534 DetailsInternetPage.loginFromDetails = function() { | 567 DetailsInternetPage.loginFromDetails = function() { |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 | 1051 |
1019 // Don't show page name in address bar and in history to prevent people | 1052 // Don't show page name in address bar and in history to prevent people |
1020 // navigate here by hand and solve issue with page session restore. | 1053 // navigate here by hand and solve issue with page session restore. |
1021 OptionsPage.showPageByName('detailsInternetPage', false); | 1054 OptionsPage.showPageByName('detailsInternetPage', false); |
1022 }; | 1055 }; |
1023 | 1056 |
1024 return { | 1057 return { |
1025 DetailsInternetPage: DetailsInternetPage | 1058 DetailsInternetPage: DetailsInternetPage |
1026 }; | 1059 }; |
1027 }); | 1060 }); |
OLD | NEW |