| 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 an API object that simulates the | 10 // * chrome.send calls will be replaced with an API object that simulates the |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 } | 110 } |
| 111 | 111 |
| 112 ///////////////////////////////////////////////////////////////////////////// | 112 ///////////////////////////////////////////////////////////////////////////// |
| 113 // DetailsInternetPage class: | 113 // DetailsInternetPage class: |
| 114 | 114 |
| 115 /** | 115 /** |
| 116 * Encapsulated handling of ChromeOS internet details overlay page. | 116 * Encapsulated handling of ChromeOS internet details overlay page. |
| 117 * @constructor | 117 * @constructor |
| 118 */ | 118 */ |
| 119 function DetailsInternetPage() { | 119 function DetailsInternetPage() { |
| 120 this.userApnIndex_ = -1; |
| 121 this.selectedApnIndex_ = -1; |
| 122 this.userApn_ = {}; |
| 120 Page.call(this, 'detailsInternetPage', null, 'details-internet-page'); | 123 Page.call(this, 'detailsInternetPage', null, 'details-internet-page'); |
| 121 } | 124 } |
| 122 | 125 |
| 123 cr.addSingletonGetter(DetailsInternetPage); | 126 cr.addSingletonGetter(DetailsInternetPage); |
| 124 | 127 |
| 125 DetailsInternetPage.prototype = { | 128 DetailsInternetPage.prototype = { |
| 126 __proto__: Page.prototype, | 129 __proto__: Page.prototype, |
| 127 | 130 |
| 128 /** @override */ | 131 /** @override */ |
| 129 initializePage: function() { | 132 initializePage: function() { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 $('details-internet-configure').addEventListener('click', | 170 $('details-internet-configure').addEventListener('click', |
| 168 function(event) { | 171 function(event) { |
| 169 DetailsInternetPage.setDetails(); | 172 DetailsInternetPage.setDetails(); |
| 170 DetailsInternetPage.configureNetwork(); | 173 DetailsInternetPage.configureNetwork(); |
| 171 }); | 174 }); |
| 172 | 175 |
| 173 $('activate-details').addEventListener('click', function(event) { | 176 $('activate-details').addEventListener('click', function(event) { |
| 174 DetailsInternetPage.activateFromDetails(); | 177 DetailsInternetPage.activateFromDetails(); |
| 175 }); | 178 }); |
| 176 | 179 |
| 177 $('buyplan-details').addEventListener('click', function(event) { | |
| 178 var data = $('connection-state').data; | |
| 179 chrome.send('buyDataPlan', [data.servicePath]); | |
| 180 PageManager.closeOverlay(); | |
| 181 }); | |
| 182 | |
| 183 $('view-account-details').addEventListener('click', function(event) { | 180 $('view-account-details').addEventListener('click', function(event) { |
| 184 var data = $('connection-state').data; | 181 chrome.send('showMorePlanInfo', |
| 185 chrome.send('showMorePlanInfo', [data.servicePath]); | 182 [DetailsInternetPage.getInstance().servicePath_]); |
| 186 PageManager.closeOverlay(); | 183 PageManager.closeOverlay(); |
| 187 }); | 184 }); |
| 188 | 185 |
| 189 $('cellular-apn-use-default').addEventListener('click', function(event) { | 186 $('cellular-apn-use-default').addEventListener('click', function(event) { |
| 190 var data = $('connection-state').data; | 187 DetailsInternetPage.getInstance().setDefaultApn_(); |
| 191 var onc = $('connection-state').onc; | |
| 192 var apnSelector = $('select-apn'); | |
| 193 | |
| 194 if (data.userApnIndex != -1) { | |
| 195 apnSelector.remove(data.userApnIndex); | |
| 196 data.userApnIndex = -1; | |
| 197 } | |
| 198 | |
| 199 var activeApn; | |
| 200 var iApn = -1; | |
| 201 var apnList = onc.getActiveValue('Cellular.APNList'); | |
| 202 if (apnList != undefined && apnList.length > 0) { | |
| 203 iApn = 0; | |
| 204 var defaultApn = apnList[iApn]; | |
| 205 activeApn['AccessPointName'] = | |
| 206 stringFromValue(defaultApn['AccessPointName']); | |
| 207 activeApn['Username'] = stringFromValue(defaultApn['Username']); | |
| 208 activeApn['Password'] = stringFromValue(defaultApn['Password']); | |
| 209 chrome.send('setApn', [data.servicePath, | |
| 210 activeApn['AccessPointName'], | |
| 211 activeApn['Username'], | |
| 212 activeApn['Password']]); | |
| 213 } | |
| 214 onc.setManagedProperty('Cellular.APN', activeApn); | |
| 215 apnSelector.selectedIndex = iApn; | |
| 216 data.selectedApn = iApn; | |
| 217 | |
| 218 updateHidden('.apn-list-view', false); | |
| 219 updateHidden('.apn-details-view', true); | |
| 220 }); | 188 }); |
| 221 | 189 |
| 222 $('cellular-apn-set').addEventListener('click', function(event) { | 190 $('cellular-apn-set').addEventListener('click', function(event) { |
| 223 if ($('cellular-apn').value == '') | 191 DetailsInternetPage.getInstance().setApn_($('cellular-apn').value); |
| 224 return; | |
| 225 | |
| 226 var data = $('connection-state').data; | |
| 227 var onc = $('connection-state').onc; | |
| 228 var apnSelector = $('select-apn'); | |
| 229 | |
| 230 var activeApn = {}; | |
| 231 activeApn['AccessPointName'] = | |
| 232 stringFromValue($('cellular-apn').value); | |
| 233 activeApn['Username'] = | |
| 234 stringFromValue($('cellular-apn-username').value); | |
| 235 activeApn['Password'] = | |
| 236 stringFromValue($('cellular-apn-password').value); | |
| 237 onc.setManagedProperty('Cellular.APN', activeApn); | |
| 238 data.userApn = activeApn; | |
| 239 chrome.send('setApn', [data.servicePath, | |
| 240 activeApn['AccessPointName'], | |
| 241 activeApn['Username'], | |
| 242 activeApn['Password']]); | |
| 243 | |
| 244 if (data.userApnIndex != -1) { | |
| 245 apnSelector.remove(data.userApnIndex); | |
| 246 data.userApnIndex = -1; | |
| 247 } | |
| 248 | |
| 249 var option = document.createElement('option'); | |
| 250 option.textContent = activeApn['AccessPointName']; | |
| 251 option.value = -1; | |
| 252 option.selected = true; | |
| 253 apnSelector.add(option, apnSelector[apnSelector.length - 1]); | |
| 254 data.userApnIndex = apnSelector.length - 2; | |
| 255 data.selectedApn = data.userApnIndex; | |
| 256 | |
| 257 updateHidden('.apn-list-view', false); | |
| 258 updateHidden('.apn-details-view', true); | |
| 259 }); | 192 }); |
| 260 | 193 |
| 261 $('cellular-apn-cancel').addEventListener('click', function(event) { | 194 $('cellular-apn-cancel').addEventListener('click', function(event) { |
| 262 $('select-apn').selectedIndex = $('connection-state').data.selectedApn; | 195 DetailsInternetPage.getInstance().cancelApn_(); |
| 263 updateHidden('.apn-list-view', false); | |
| 264 updateHidden('.apn-details-view', true); | |
| 265 }); | 196 }); |
| 266 | 197 |
| 267 $('select-apn').addEventListener('change', function(event) { | 198 $('select-apn').addEventListener('change', function(event) { |
| 268 var data = $('connection-state').data; | 199 DetailsInternetPage.getInstance().selectApn_(); |
| 269 var onc = $('connection-state').onc; | |
| 270 var apnSelector = $('select-apn'); | |
| 271 var apnDict; | |
| 272 if (apnSelector[apnSelector.selectedIndex].value != -1) { | |
| 273 var apnList = onc.getActiveValue('Cellular.APNList'); | |
| 274 var apnIndex = apnSelector.selectedIndex; | |
| 275 assert(apnIndex < apnList.length); | |
| 276 apnDict = apnList[apnIndex]; | |
| 277 chrome.send('setApn', [data.servicePath, | |
| 278 stringFromValue(apnDict['AccessPointName']), | |
| 279 stringFromValue(apnDict['Username']), | |
| 280 stringFromValue(apnDict['Password'])]); | |
| 281 data.selectedApn = apnIndex; | |
| 282 } else if (apnSelector.selectedIndex == data.userApnIndex) { | |
| 283 apnDict = data.userApn; | |
| 284 chrome.send('setApn', [data.servicePath, | |
| 285 stringFromValue(apnDict['AccessPointName']), | |
| 286 stringFromValue(apnDict['Username']), | |
| 287 stringFromValue(apnDict['Password'])]); | |
| 288 data.selectedApn = apnSelector.selectedIndex; | |
| 289 } else { | |
| 290 apnDict = onc.getActiveValue('Cellular.APN'); | |
| 291 $('cellular-apn').value = stringFromValue(apnDict['AccessPointName']); | |
| 292 $('cellular-apn-username').value = | |
| 293 stringFromValue(apnDict['Username']); | |
| 294 $('cellular-apn-password').value = | |
| 295 stringFromValue(apnDict['Password']); | |
| 296 | |
| 297 updateHidden('.apn-list-view', true); | |
| 298 updateHidden('.apn-details-view', false); | |
| 299 } | |
| 300 }); | 200 }); |
| 301 | 201 |
| 302 $('sim-card-lock-enabled').addEventListener('click', function(event) { | 202 $('sim-card-lock-enabled').addEventListener('click', function(event) { |
| 303 var newValue = $('sim-card-lock-enabled').checked; | 203 var newValue = $('sim-card-lock-enabled').checked; |
| 304 // Leave value as is because user needs to enter PIN code first. | 204 // Leave value as is because user needs to enter PIN code first. |
| 305 // When PIN will be entered and value changed, | 205 // When PIN will be entered and value changed, |
| 306 // we'll update UI to reflect that change. | 206 // we'll update UI to reflect that change. |
| 307 $('sim-card-lock-enabled').checked = !newValue; | 207 $('sim-card-lock-enabled').checked = !newValue; |
| 308 chrome.send('setSimCardLock', [newValue]); | 208 chrome.send('setSimCardLock', [newValue]); |
| 309 }); | 209 }); |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 // this device is connected. This is so that you can fix the ip configs | 383 // this device is connected. This is so that you can fix the ip configs |
| 484 // if you can't connect to any network. | 384 // if you can't connect to any network. |
| 485 // TODO(chocobo): Once ipconfig is moved to flimflam service objects, | 385 // TODO(chocobo): Once ipconfig is moved to flimflam service objects, |
| 486 // we need to redo this logic to allow configuration of all networks. | 386 // we need to redo this logic to allow configuration of all networks. |
| 487 $('ipconfig-section').hidden = !this.connected && this.deviceConnected; | 387 $('ipconfig-section').hidden = !this.connected && this.deviceConnected; |
| 488 $('ipconfig-dns-section').hidden = | 388 $('ipconfig-dns-section').hidden = |
| 489 !this.connected && this.deviceConnected; | 389 !this.connected && this.deviceConnected; |
| 490 | 390 |
| 491 // Network type related. | 391 // Network type related. |
| 492 updateHidden('#details-internet-page .cellular-details', | 392 updateHidden('#details-internet-page .cellular-details', |
| 493 this.type != 'Cellular'); | 393 this.type_ != 'Cellular'); |
| 494 updateHidden('#details-internet-page .wifi-details', | 394 updateHidden('#details-internet-page .wifi-details', |
| 495 this.type != 'WiFi'); | 395 this.type_ != 'WiFi'); |
| 496 updateHidden('#details-internet-page .wimax-details', | 396 updateHidden('#details-internet-page .wimax-details', |
| 497 this.type != 'Wimax'); | 397 this.type_ != 'Wimax'); |
| 498 updateHidden('#details-internet-page .vpn-details', this.type != 'VPN'); | 398 updateHidden('#details-internet-page .vpn-details', this.type_ != 'VPN'); |
| 499 updateHidden('#details-internet-page .proxy-details', !this.showProxy); | 399 updateHidden('#details-internet-page .proxy-details', !this.showProxy); |
| 500 | 400 |
| 501 // Cellular | 401 // Cellular |
| 502 | 402 |
| 503 // Conditionally call updateHidden on .gsm-only, so that we don't unhide | 403 // Conditionally call updateHidden on .gsm-only, so that we don't unhide |
| 504 // a previously hidden element. | 404 // a previously hidden element. |
| 505 if (this.gsm) | 405 if (this.gsm) |
| 506 updateHidden('#details-internet-page .cdma-only', true); | 406 updateHidden('#details-internet-page .cdma-only', true); |
| 507 else | 407 else |
| 508 updateHidden('#details-internet-page .gsm-only', true); | 408 updateHidden('#details-internet-page .gsm-only', true); |
| 509 | 409 |
| 510 // Wifi | 410 // Wifi |
| 511 | 411 |
| 512 // Hide network tab for VPN. | 412 // Hide network tab for VPN. |
| 513 updateHidden('#details-internet-page .network-details', | 413 updateHidden('#details-internet-page .network-details', |
| 514 this.type == 'VPN'); | 414 this.type_ == 'VPN'); |
| 515 | 415 |
| 516 // Password and shared. | 416 // Password and shared. |
| 517 updateHidden('#details-internet-page #password-details', | 417 updateHidden('#details-internet-page #password-details', |
| 518 this.type != 'WiFi' || !this.hasSecurity); | 418 this.type_ != 'WiFi' || !this.hasSecurity); |
| 519 updateHidden('#details-internet-page #wifi-shared-network', | 419 updateHidden('#details-internet-page #wifi-shared-network', |
| 520 !this.shared); | 420 !this.shared); |
| 521 updateHidden('#details-internet-page #prefer-network', | 421 updateHidden('#details-internet-page #prefer-network', |
| 522 !this.showPreferred); | 422 !this.showPreferred); |
| 523 | 423 |
| 524 // WiMAX. | 424 // WiMAX. |
| 525 updateHidden('#details-internet-page #wimax-shared-network', | 425 updateHidden('#details-internet-page #wimax-shared-network', |
| 526 !this.shared); | 426 !this.shared); |
| 527 | 427 |
| 528 // Proxy | 428 // Proxy |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 $('ftp-proxy').disabled = allDisabled; | 543 $('ftp-proxy').disabled = allDisabled; |
| 644 $('ftp-proxy-port').disabled = allDisabled; | 544 $('ftp-proxy-port').disabled = allDisabled; |
| 645 $('socks-host').disabled = allDisabled; | 545 $('socks-host').disabled = allDisabled; |
| 646 $('socks-port').disabled = allDisabled; | 546 $('socks-port').disabled = allDisabled; |
| 647 $('proxy-use-pac-url').disabled = true; | 547 $('proxy-use-pac-url').disabled = true; |
| 648 $('proxy-pac-url').disabled = true; | 548 $('proxy-pac-url').disabled = true; |
| 649 $('auto-proxy-parms').hidden = !$('auto-proxy').checked; | 549 $('auto-proxy-parms').hidden = !$('auto-proxy').checked; |
| 650 $('manual-proxy-parms').hidden = !$('manual-proxy').checked; | 550 $('manual-proxy-parms').hidden = !$('manual-proxy').checked; |
| 651 chrome.send('coreOptionsUserMetricsAction', | 551 chrome.send('coreOptionsUserMetricsAction', |
| 652 ['Options_NetworkManualProxy_Enable']); | 552 ['Options_NetworkManualProxy_Enable']); |
| 553 }, |
| 554 |
| 555 updateConnectionButtonVisibilty_: function() { |
| 556 var onc = this.onc_; |
| 557 if (this.type_ == 'Ethernet') { |
| 558 // Ethernet can never be connected or disconnected and can always be |
| 559 // configured (e.g. to set security). |
| 560 $('details-internet-login').hidden = true; |
| 561 $('details-internet-disconnect').hidden = true; |
| 562 $('details-internet-configure').hidden = false; |
| 563 return; |
| 564 } |
| 565 |
| 566 var connectState = onc.getActiveValue('ConnectionState'); |
| 567 if (connectState == 'NotConnected') { |
| 568 $('details-internet-login').hidden = false; |
| 569 // Connecting to an unconfigured network might trigger certificate |
| 570 // installation UI. Until that gets handled here, always enable the |
| 571 // Connect button. |
| 572 $('details-internet-login').disabled = false; |
| 573 $('details-internet-disconnect').hidden = true; |
| 574 } else { |
| 575 $('details-internet-login').hidden = true; |
| 576 $('details-internet-disconnect').hidden = false; |
| 577 } |
| 578 |
| 579 var connectable = onc.getActiveValue('Connectable'); |
| 580 if (connectState != 'Connected' && |
| 581 (!connectable || this.hasSecurity || |
| 582 (this.type_ == 'Wimax' || this.type_ == 'VPN'))) { |
| 583 $('details-internet-configure').hidden = false; |
| 584 } else { |
| 585 $('details-internet-configure').hidden = true; |
| 586 } |
| 587 }, |
| 588 |
| 589 populateHeader_: function() { |
| 590 var onc = this.onc_; |
| 591 |
| 592 $('network-details-title').textContent = onc.getTranslatedValue('Name'); |
| 593 var connectionState = onc.getActiveValue('ConnectionState'); |
| 594 var connectionStateString = onc.getTranslatedValue('ConnectionState'); |
| 595 this.connected = connectionState == 'Connected'; |
| 596 $('network-details-subtitle-status').textContent = connectionStateString; |
| 597 var typeKey; |
| 598 var type = this.type_; |
| 599 if (type == 'Ethernet') |
| 600 typeKey = 'ethernetTitle'; |
| 601 else if (type == 'WiFi') |
| 602 typeKey = 'wifiTitle'; |
| 603 else if (type == 'Wimax') |
| 604 typeKey = 'wimaxTitle'; |
| 605 else if (type == 'Cellular') |
| 606 typeKey = 'cellularTitle'; |
| 607 else if (type == 'VPN') |
| 608 typeKey = 'vpnTitle'; |
| 609 else |
| 610 typeKey = null; |
| 611 var typeLabel = $('network-details-subtitle-type'); |
| 612 var typeSeparator = $('network-details-subtitle-separator'); |
| 613 if (typeKey) { |
| 614 typeLabel.textContent = loadTimeData.getString(typeKey); |
| 615 typeLabel.hidden = false; |
| 616 typeSeparator.hidden = false; |
| 617 } else { |
| 618 typeLabel.hidden = true; |
| 619 typeSeparator.hidden = true; |
| 620 } |
| 621 }, |
| 622 |
| 623 initializeApnList_: function(onc) { |
| 624 var apnSelector = $('select-apn'); |
| 625 // Clear APN lists, keep only last element that "other". |
| 626 while (apnSelector.length != 1) { |
| 627 apnSelector.remove(0); |
| 628 } |
| 629 var otherOption = apnSelector[0]; |
| 630 var activeApn = onc.getActiveValue('Cellular.APN.AccessPointName'); |
| 631 var activeUsername = onc.getActiveValue('Cellular.APN.Username'); |
| 632 var activePassword = onc.getActiveValue('Cellular.APN.Password'); |
| 633 var lastGoodApn = |
| 634 onc.getActiveValue('Cellular.LastGoodAPN.AccessPointName'); |
| 635 var lastGoodUsername = |
| 636 onc.getActiveValue('Cellular.LastGoodAPN.Username'); |
| 637 var lastGoodPassword = |
| 638 onc.getActiveValue('Cellular.LastGoodAPN.Password'); |
| 639 var apnList = onc.getActiveValue('Cellular.APNList'); |
| 640 for (var i = 0; i < apnList.length; i++) { |
| 641 var apnDict = apnList[i]; |
| 642 var option = document.createElement('option'); |
| 643 var localizedName = apnDict['LocalizedName']; |
| 644 var name = localizedName ? localizedName : apnDict['Name']; |
| 645 var accessPointName = apnDict['AccessPointName']; |
| 646 option.textContent = |
| 647 name ? (name + ' (' + accessPointName + ')') : accessPointName; |
| 648 option.value = i; |
| 649 // If this matches the active Apn, or LastGoodApn, set it as the |
| 650 // selected Apn. |
| 651 if ((activeApn == accessPointName && |
| 652 activeUsername == apnDict['Username'] && |
| 653 activePassword == apnDict['Password']) || |
| 654 (!activeApn && |
| 655 lastGoodApn == accessPointName && |
| 656 lastGoodUsername == apnDict['Username'] && |
| 657 lastGoodPassword == apnDict['Password'])) { |
| 658 this.selectedApnIndex_ = i; |
| 659 } |
| 660 // Insert new option before "other" option. |
| 661 apnSelector.add(option, otherOption); |
| 662 } |
| 663 if (this.selectedApnIndex_ == -1 && activeApn) { |
| 664 var activeOption = document.createElement('option'); |
| 665 activeOption.textContent = activeApn; |
| 666 activeOption.value = -1; |
| 667 apnSelector.add(activeOption, otherOption); |
| 668 this.selectedApnIndex_ = apnSelector.length - 2; |
| 669 this.userApnIndex_ = this.selectedApnIndex_; |
| 670 } |
| 671 assert(this.selectedApnIndex_ >= 0); |
| 672 apnSelector.selectedIndex = this.selectedApnIndex_; |
| 673 updateHidden('.apn-list-view', false); |
| 674 updateHidden('.apn-details-view', true); |
| 675 }, |
| 676 |
| 677 setDefaultApn_: function() { |
| 678 var onc = this.onc_; |
| 679 var apnSelector = $('select-apn'); |
| 680 |
| 681 if (this.userApnIndex_ != -1) { |
| 682 apnSelector.remove(this.userApnIndex_); |
| 683 this.userApnIndex_ = -1; |
| 684 } |
| 685 |
| 686 var iApn = -1; |
| 687 var apnList = onc.getActiveValue('Cellular.APNList'); |
| 688 if (apnList != undefined && apnList.length > 0) { |
| 689 iApn = 0; |
| 690 var defaultApn = apnList[iApn]; |
| 691 var activeApn = {}; |
| 692 activeApn['AccessPointName'] = |
| 693 stringFromValue(defaultApn['AccessPointName']); |
| 694 activeApn['Username'] = stringFromValue(defaultApn['Username']); |
| 695 activeApn['Password'] = stringFromValue(defaultApn['Password']); |
| 696 onc.setManagedProperty('Cellular.APN', activeApn); |
| 697 chrome.send('setApn', [this.servicePath_, |
| 698 activeApn['AccessPointName'], |
| 699 activeApn['Username'], |
| 700 activeApn['Password']]); |
| 701 } |
| 702 apnSelector.selectedIndex = iApn; |
| 703 this.selectedApnIndex_ = iApn; |
| 704 |
| 705 updateHidden('.apn-list-view', false); |
| 706 updateHidden('.apn-details-view', true); |
| 707 }, |
| 708 |
| 709 setApn_: function(apnValue) { |
| 710 if (apnValue == '') |
| 711 return; |
| 712 |
| 713 var onc = this.onc_; |
| 714 var apnSelector = $('select-apn'); |
| 715 |
| 716 var activeApn = {}; |
| 717 activeApn['AccessPointName'] = stringFromValue(apnValue); |
| 718 activeApn['Username'] = stringFromValue($('cellular-apn-username').value); |
| 719 activeApn['Password'] = stringFromValue($('cellular-apn-password').value); |
| 720 onc.setManagedProperty('Cellular.APN', activeApn); |
| 721 this.userApn_ = activeApn; |
| 722 chrome.send('setApn', [this.servicePath_, |
| 723 activeApn['AccessPointName'], |
| 724 activeApn['Username'], |
| 725 activeApn['Password']]); |
| 726 |
| 727 if (this.userApnIndex_ != -1) { |
| 728 apnSelector.remove(this.userApnIndex_); |
| 729 this.userApnIndex_ = -1; |
| 730 } |
| 731 |
| 732 var option = document.createElement('option'); |
| 733 option.textContent = activeApn['AccessPointName']; |
| 734 option.value = -1; |
| 735 option.selected = true; |
| 736 apnSelector.add(option, apnSelector[apnSelector.length - 1]); |
| 737 this.userApnIndex_ = apnSelector.length - 2; |
| 738 this.selectedApnIndex_ = this.userApnIndex_; |
| 739 |
| 740 updateHidden('.apn-list-view', false); |
| 741 updateHidden('.apn-details-view', true); |
| 742 }, |
| 743 |
| 744 cancelApn_: function() { |
| 745 $('select-apn').selectedIndex = this.selectedApnIndex_; |
| 746 updateHidden('.apn-list-view', false); |
| 747 updateHidden('.apn-details-view', true); |
| 748 }, |
| 749 |
| 750 selectApn_: function() { |
| 751 var onc = this.onc_; |
| 752 var apnSelector = $('select-apn'); |
| 753 var apnDict; |
| 754 if (apnSelector[apnSelector.selectedIndex].value != -1) { |
| 755 var apnList = onc.getActiveValue('Cellular.APNList'); |
| 756 var apnIndex = apnSelector.selectedIndex; |
| 757 assert(apnIndex < apnList.length); |
| 758 apnDict = apnList[apnIndex]; |
| 759 chrome.send('setApn', [this.servicePath_, |
| 760 stringFromValue(apnDict['AccessPointName']), |
| 761 stringFromValue(apnDict['Username']), |
| 762 stringFromValue(apnDict['Password'])]); |
| 763 this.selectedApnIndex_ = apnIndex; |
| 764 } else if (apnSelector.selectedIndex == this.userApnIndex_) { |
| 765 apnDict = this.userApn_; |
| 766 chrome.send('setApn', [this.servicePath_, |
| 767 stringFromValue(apnDict['AccessPointName']), |
| 768 stringFromValue(apnDict['Username']), |
| 769 stringFromValue(apnDict['Password'])]); |
| 770 this.selectedApnIndex_ = apnSelector.selectedIndex; |
| 771 } else { |
| 772 $('cellular-apn').value = |
| 773 stringFromValue(onc.getActiveValue('Cellular.APN.AccessPointName')); |
| 774 $('cellular-apn-username').value = |
| 775 stringFromValue(onc.getActiveValue('Cellular.APN.Username')); |
| 776 $('cellular-apn-password').value = |
| 777 stringFromValue(onc.getActiveValue('Cellular.APN.Password')); |
| 778 updateHidden('.apn-list-view', true); |
| 779 updateHidden('.apn-details-view', false); |
| 780 } |
| 653 } | 781 } |
| 654 }; | 782 }; |
| 655 | 783 |
| 656 /** | 784 /** |
| 657 * Enables or Disables all buttons that provide operations on the cellular | 785 * Enables or Disables all buttons that provide operations on the cellular |
| 658 * network. | 786 * network. |
| 659 */ | 787 */ |
| 660 DetailsInternetPage.changeCellularButtonsState = function(disable) { | 788 DetailsInternetPage.changeCellularButtonsState = function(disable) { |
| 661 var buttonsToDisableList = | 789 var buttonsToDisableList = |
| 662 new Array('details-internet-login', | 790 new Array('details-internet-login', |
| 663 'details-internet-disconnect', | 791 'details-internet-disconnect', |
| 664 'details-internet-configure', | 792 'details-internet-configure', |
| 665 'activate-details', | 793 'activate-details', |
| 666 'buyplan-details', | |
| 667 'view-account-details'); | 794 'view-account-details'); |
| 668 | 795 |
| 669 for (var i = 0; i < buttonsToDisableList.length; ++i) { | 796 for (var i = 0; i < buttonsToDisableList.length; ++i) { |
| 670 var button = $(buttonsToDisableList[i]); | 797 var button = $(buttonsToDisableList[i]); |
| 671 button.disabled = disable; | 798 button.disabled = disable; |
| 672 } | 799 } |
| 673 }; | 800 }; |
| 674 | 801 |
| 675 /** | 802 /** |
| 676 * Shows a spinner while the carrier is changed. | 803 * Shows a spinner while the carrier is changed. |
| 677 */ | 804 */ |
| 678 DetailsInternetPage.showCarrierChangeSpinner = function(visible) { | 805 DetailsInternetPage.showCarrierChangeSpinner = function(visible) { |
| 679 $('switch-carrier-spinner').hidden = !visible; | 806 $('switch-carrier-spinner').hidden = !visible; |
| 680 // Disable any buttons that allow us to operate on cellular networks. | 807 // Disable any buttons that allow us to operate on cellular networks. |
| 681 DetailsInternetPage.changeCellularButtonsState(visible); | 808 DetailsInternetPage.changeCellularButtonsState(visible); |
| 682 }; | 809 }; |
| 683 | 810 |
| 684 /** | 811 /** |
| 685 * Changes the network carrier. | 812 * Changes the network carrier. |
| 686 */ | 813 */ |
| 687 DetailsInternetPage.handleCarrierChanged = function() { | 814 DetailsInternetPage.handleCarrierChanged = function() { |
| 688 var carrierSelector = $('select-carrier'); | 815 var carrierSelector = $('select-carrier'); |
| 689 var carrier = carrierSelector[carrierSelector.selectedIndex].textContent; | 816 var carrier = carrierSelector[carrierSelector.selectedIndex].textContent; |
| 690 DetailsInternetPage.showCarrierChangeSpinner(true); | 817 DetailsInternetPage.showCarrierChangeSpinner(true); |
| 691 var data = $('connection-state').data; | 818 chrome.send('setCarrier', [ |
| 692 chrome.send('setCarrier', [data.servicePath, carrier]); | 819 DetailsInternetPage.getInstance().servicePath_, carrier]); |
| 693 }; | 820 }; |
| 694 | 821 |
| 695 /** | 822 /** |
| 696 * Performs minimal initialization of the InternetDetails dialog in | 823 * Performs minimal initialization of the InternetDetails dialog in |
| 697 * preparation for showing proxy-setttings. | 824 * preparation for showing proxy-setttings. |
| 698 */ | 825 */ |
| 699 DetailsInternetPage.initializeProxySettings = function() { | 826 DetailsInternetPage.initializeProxySettings = function() { |
| 700 var detailsPage = DetailsInternetPage.getInstance(); | 827 DetailsInternetPage.getInstance().initializePageContents_(); |
| 701 detailsPage.initializePageContents_(); | |
| 702 }; | 828 }; |
| 703 | 829 |
| 704 /** | 830 /** |
| 705 * Displays the InternetDetails dialog with only the proxy settings visible. | 831 * Displays the InternetDetails dialog with only the proxy settings visible. |
| 706 */ | 832 */ |
| 707 DetailsInternetPage.showProxySettings = function() { | 833 DetailsInternetPage.showProxySettings = function() { |
| 708 var detailsPage = DetailsInternetPage.getInstance(); | 834 var detailsPage = DetailsInternetPage.getInstance(); |
| 709 $('network-details-header').hidden = true; | 835 $('network-details-header').hidden = true; |
| 710 $('buyplan-details').hidden = true; | |
| 711 $('activate-details').hidden = true; | 836 $('activate-details').hidden = true; |
| 712 $('view-account-details').hidden = true; | 837 $('view-account-details').hidden = true; |
| 713 $('web-proxy-auto-discovery').hidden = true; | 838 $('web-proxy-auto-discovery').hidden = true; |
| 714 detailsPage.showProxy = true; | 839 detailsPage.showProxy = true; |
| 715 updateHidden('#internet-tab', true); | 840 updateHidden('#internet-tab', true); |
| 716 updateHidden('#details-tab-strip', true); | 841 updateHidden('#details-tab-strip', true); |
| 717 updateHidden('#details-internet-page .action-area', true); | 842 updateHidden('#details-internet-page .action-area', true); |
| 718 detailsPage.updateControls(); | 843 detailsPage.updateControls(); |
| 719 detailsPage.visible = true; | 844 detailsPage.visible = true; |
| 720 chrome.send('coreOptionsUserMetricsAction', | 845 chrome.send('coreOptionsUserMetricsAction', |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 $(proxyPort).value = hostValue[1]; | 884 $(proxyPort).value = hostValue[1]; |
| 760 } | 885 } |
| 761 } | 886 } |
| 762 }; | 887 }; |
| 763 | 888 |
| 764 DetailsInternetPage.updateCarrier = function() { | 889 DetailsInternetPage.updateCarrier = function() { |
| 765 DetailsInternetPage.showCarrierChangeSpinner(false); | 890 DetailsInternetPage.showCarrierChangeSpinner(false); |
| 766 }; | 891 }; |
| 767 | 892 |
| 768 DetailsInternetPage.loginFromDetails = function() { | 893 DetailsInternetPage.loginFromDetails = function() { |
| 769 var data = $('connection-state').data; | 894 var detailsPage = DetailsInternetPage.getInstance(); |
| 770 var servicePath = data.servicePath; | 895 chrome.send('networkCommand', |
| 771 chrome.send('networkCommand', [data.type, servicePath, 'connect']); | 896 [detailsPage.type_, detailsPage.servicePath_, 'connect']); |
| 772 PageManager.closeOverlay(); | 897 PageManager.closeOverlay(); |
| 773 }; | 898 }; |
| 774 | 899 |
| 775 DetailsInternetPage.disconnectNetwork = function() { | 900 DetailsInternetPage.disconnectNetwork = function() { |
| 776 var data = $('connection-state').data; | 901 var detailsPage = DetailsInternetPage.getInstance(); |
| 777 var servicePath = data.servicePath; | 902 chrome.send('networkCommand', |
| 778 chrome.send('networkCommand', [data.type, servicePath, 'disconnect']); | 903 [detailsPage.type_, detailsPage.servicePath_, 'disconnect']); |
| 779 PageManager.closeOverlay(); | 904 PageManager.closeOverlay(); |
| 780 }; | 905 }; |
| 781 | 906 |
| 782 DetailsInternetPage.configureNetwork = function() { | 907 DetailsInternetPage.configureNetwork = function() { |
| 783 var data = $('connection-state').data; | 908 var detailsPage = DetailsInternetPage.getInstance(); |
| 784 var servicePath = data.servicePath; | 909 chrome.send('networkCommand', |
| 785 chrome.send('networkCommand', [data.type, servicePath, 'configure']); | 910 [detailsPage.type_, detailsPage.servicePath_, 'configure']); |
| 786 PageManager.closeOverlay(); | 911 PageManager.closeOverlay(); |
| 787 }; | 912 }; |
| 788 | 913 |
| 789 DetailsInternetPage.activateFromDetails = function() { | 914 DetailsInternetPage.activateFromDetails = function() { |
| 790 var data = $('connection-state').data; | 915 var detailsPage = DetailsInternetPage.getInstance(); |
| 791 var servicePath = data.servicePath; | 916 if (detailsPage.type_ == 'Cellular') { |
| 792 if (data.type == 'Cellular') | 917 chrome.send('networkCommand', |
| 793 chrome.send('networkCommand', [data.type, servicePath, 'activate']); | 918 [detailsPage.type_, detailsPage.servicePath_, 'activate']); |
| 919 } |
| 794 PageManager.closeOverlay(); | 920 PageManager.closeOverlay(); |
| 795 }; | 921 }; |
| 796 | 922 |
| 797 DetailsInternetPage.setDetails = function() { | 923 DetailsInternetPage.setDetails = function() { |
| 798 var data = $('connection-state').data; | 924 var detailsPage = DetailsInternetPage.getInstance(); |
| 799 var servicePath = data.servicePath; | 925 var type = detailsPage.type_; |
| 800 if (data.type == 'WiFi') { | 926 var servicePath = detailsPage.servicePath_; |
| 927 if (type == 'WiFi') { |
| 801 sendCheckedIfEnabled(servicePath, 'setPreferNetwork', | 928 sendCheckedIfEnabled(servicePath, 'setPreferNetwork', |
| 802 $('prefer-network-wifi')); | 929 $('prefer-network-wifi')); |
| 803 sendCheckedIfEnabled(servicePath, 'setAutoConnect', | 930 sendCheckedIfEnabled(servicePath, 'setAutoConnect', |
| 804 $('auto-connect-network-wifi')); | 931 $('auto-connect-network-wifi')); |
| 805 } else if (data.type == 'Wimax') { | 932 } else if (type == 'Wimax') { |
| 806 sendCheckedIfEnabled(servicePath, 'setAutoConnect', | 933 sendCheckedIfEnabled(servicePath, 'setAutoConnect', |
| 807 $('auto-connect-network-wimax')); | 934 $('auto-connect-network-wimax')); |
| 808 } else if (data.type == 'Cellular') { | 935 } else if (type == 'Cellular') { |
| 809 sendCheckedIfEnabled(servicePath, 'setAutoConnect', | 936 sendCheckedIfEnabled(servicePath, 'setAutoConnect', |
| 810 $('auto-connect-network-cellular')); | 937 $('auto-connect-network-cellular')); |
| 811 } else if (data.type == 'VPN') { | 938 } else if (type == 'VPN') { |
| 812 chrome.send('setServerHostname', | 939 chrome.send('setServerHostname', |
| 813 [servicePath, | 940 [servicePath, |
| 814 $('inet-server-hostname').value]); | 941 $('inet-server-hostname').value]); |
| 815 sendCheckedIfEnabled(servicePath, 'setAutoConnect', | 942 sendCheckedIfEnabled(servicePath, 'setAutoConnect', |
| 816 $('auto-connect-network-vpn')); | 943 $('auto-connect-network-vpn')); |
| 817 } | 944 } |
| 818 | 945 |
| 819 var nameServerTypes = ['automatic', 'google', 'user']; | 946 var nameServerTypes = ['automatic', 'google', 'user']; |
| 820 var nameServerType = 'automatic'; | 947 var nameServerType = 'automatic'; |
| 821 for (var i = 0; i < nameServerTypes.length; ++i) { | 948 for (var i = 0; i < nameServerTypes.length; ++i) { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 userDns.removeAttribute('selected'); | 999 userDns.removeAttribute('selected'); |
| 873 break; | 1000 break; |
| 874 case 'user': | 1001 case 'user': |
| 875 automaticDns.removeAttribute('selected'); | 1002 automaticDns.removeAttribute('selected'); |
| 876 googleDns.removeAttribute('selected'); | 1003 googleDns.removeAttribute('selected'); |
| 877 userDns.setAttribute('selected', ''); | 1004 userDns.setAttribute('selected', ''); |
| 878 break; | 1005 break; |
| 879 } | 1006 } |
| 880 }; | 1007 }; |
| 881 | 1008 |
| 882 DetailsInternetPage.updateConnectionButtonVisibilty = function(onc) { | |
| 883 if (onc.type == 'Ethernet') { | |
| 884 // Ethernet can never be connected or disconnected and can always be | |
| 885 // configured (e.g. to set security). | |
| 886 $('details-internet-login').hidden = true; | |
| 887 $('details-internet-disconnect').hidden = true; | |
| 888 $('details-internet-configure').hidden = false; | |
| 889 return; | |
| 890 } | |
| 891 | |
| 892 var connectState = onc.getActiveValue('ConnectionState'); | |
| 893 if (connectState == 'NotConnected') { | |
| 894 $('details-internet-login').hidden = false; | |
| 895 // Connecting to an unconfigured network might trigger certificate | |
| 896 // installation UI. Until that gets handled here, always enable the | |
| 897 // Connect button. | |
| 898 $('details-internet-login').disabled = false; | |
| 899 $('details-internet-disconnect').hidden = true; | |
| 900 } else { | |
| 901 $('details-internet-login').hidden = true; | |
| 902 $('details-internet-disconnect').hidden = false; | |
| 903 } | |
| 904 | |
| 905 var connectable = onc.getActiveValue('Connectable'); | |
| 906 if (connectState != 'Connected' && | |
| 907 (!connectable || this.hasSecurity || | |
| 908 (onc.type == 'Wimax' || onc.type == 'VPN'))) { | |
| 909 $('details-internet-configure').hidden = false; | |
| 910 } else { | |
| 911 $('details-internet-configure').hidden = true; | |
| 912 } | |
| 913 }; | |
| 914 | |
| 915 DetailsInternetPage.populateHeader = function(detailsPage, onc) { | |
| 916 $('network-details-title').textContent = onc.getTranslatedValue('Name'); | |
| 917 var connectionState = onc.getActiveValue('ConnectionState'); | |
| 918 var connectionStateString = onc.getTranslatedValue('ConnectionState'); | |
| 919 detailsPage.connected = connectionState == 'Connected'; | |
| 920 $('network-details-subtitle-status').textContent = connectionStateString; | |
| 921 var typeKey; | |
| 922 if (onc.type == 'Ethernet') | |
| 923 typeKey = 'ethernetTitle'; | |
| 924 else if (onc.type == 'WiFi') | |
| 925 typeKey = 'wifiTitle'; | |
| 926 else if (onc.type == 'Wimax') | |
| 927 typeKey = 'wimaxTitle'; | |
| 928 else if (onc.type == 'Cellular') | |
| 929 typeKey = 'cellularTitle'; | |
| 930 else if (onc.type == 'VPN') | |
| 931 typeKey = 'vpnTitle'; | |
| 932 else | |
| 933 typeKey = null; | |
| 934 var typeLabel = $('network-details-subtitle-type'); | |
| 935 var typeSeparator = $('network-details-subtitle-separator'); | |
| 936 if (typeKey) { | |
| 937 typeLabel.textContent = loadTimeData.getString(typeKey); | |
| 938 typeLabel.hidden = false; | |
| 939 typeSeparator.hidden = false; | |
| 940 } else { | |
| 941 typeLabel.hidden = true; | |
| 942 typeSeparator.hidden = true; | |
| 943 } | |
| 944 }; | |
| 945 | |
| 946 DetailsInternetPage.updateConnectionData = function(update) { | 1009 DetailsInternetPage.updateConnectionData = function(update) { |
| 947 var detailsPage = DetailsInternetPage.getInstance(); | 1010 var detailsPage = DetailsInternetPage.getInstance(); |
| 948 if (!detailsPage.visible) | 1011 if (!detailsPage.visible) |
| 949 return; | 1012 return; |
| 950 | 1013 |
| 951 var data = $('connection-state').data; | 1014 if (update.servicePath != detailsPage.servicePath_) |
| 952 if (!data) | |
| 953 return; | |
| 954 | |
| 955 if (update.servicePath != data.servicePath) | |
| 956 return; | 1015 return; |
| 957 | 1016 |
| 958 // Update our cached data object. | 1017 // Update our cached data object. |
| 959 updateDataObject(data, update); | 1018 var onc = detailsPage.onc_; |
| 960 var onc = new OncData(data); | 1019 onc.updateData(update); |
| 961 | 1020 |
| 962 this.populateHeader(detailsPage, onc); | 1021 detailsPage.populateHeader_(); |
| 963 | 1022 |
| 964 var connectionState = onc.getActiveValue('ConnectionState'); | 1023 var connectionState = onc.getActiveValue('ConnectionState'); |
| 965 var connectionStateString = onc.getTranslatedValue('ConnectionState'); | 1024 var connectionStateString = onc.getTranslatedValue('ConnectionState'); |
| 966 detailsPage.deviceConnected = data.deviceConnected; | 1025 if ('deviceConnected' in update) |
| 1026 detailsPage.deviceConnected = update.deviceConnected; |
| 967 detailsPage.connected = connectionState == 'Connected'; | 1027 detailsPage.connected = connectionState == 'Connected'; |
| 968 $('connection-state').textContent = connectionStateString; | 1028 $('connection-state').textContent = connectionStateString; |
| 969 | 1029 |
| 970 this.updateConnectionButtonVisibilty(onc); | 1030 detailsPage.updateConnectionButtonVisibilty_(); |
| 971 | 1031 |
| 972 if (onc.type == 'WiFi') { | 1032 var type = detailsPage.type_; |
| 1033 if (type == 'WiFi') { |
| 973 $('wifi-connection-state').textContent = connectionStateString; | 1034 $('wifi-connection-state').textContent = connectionStateString; |
| 974 } else if (onc.type == 'Wimax') { | 1035 } else if (type == 'Wimax') { |
| 975 $('wimax-connection-state').textContent = connectionStateString; | 1036 $('wimax-connection-state').textContent = connectionStateString; |
| 976 } else if (onc.type == 'Cellular') { | 1037 } else if (type == 'Cellular') { |
| 977 $('activation-state').textContent = | 1038 $('activation-state').textContent = |
| 978 onc.getTranslatedValue('Cellular.ActivationState'); | 1039 onc.getTranslatedValue('Cellular.ActivationState'); |
| 979 $('buyplan-details').hidden = !data.showBuyButton; | 1040 // These properties are only defined if they are true. |
| 980 $('view-account-details').hidden = !data.showViewAccountButton; | 1041 $('view-account-details').hidden = !update.showViewAccountButton; |
| 981 | 1042 $('activate-details').hidden = !update.showActivateButton; |
| 982 $('activate-details').hidden = !data.showActivateButton; | 1043 if (update.showActivateButton) |
| 983 if (data.showActivateButton) | |
| 984 $('details-internet-login').hidden = true; | 1044 $('details-internet-login').hidden = true; |
| 985 | 1045 |
| 986 if (detailsPage.gsm) { | 1046 if (detailsPage.gsm) { |
| 987 var lockEnabled = | 1047 var lockEnabled = |
| 988 onc.getActiveValue('Cellular.SIMLockStatus.LockEnabled'); | 1048 onc.getActiveValue('Cellular.SIMLockStatus.LockEnabled'); |
| 989 $('sim-card-lock-enabled').checked = lockEnabled; | 1049 $('sim-card-lock-enabled').checked = lockEnabled; |
| 990 $('change-pin').hidden = !lockEnabled; | 1050 $('change-pin').hidden = !lockEnabled; |
| 991 } | 1051 } |
| 992 } | 1052 } |
| 993 | |
| 994 $('connection-state').data = data; | |
| 995 $('connection-state').onc = onc; | |
| 996 }; | 1053 }; |
| 997 | 1054 |
| 998 DetailsInternetPage.showDetailedInfo = function(data) { | 1055 DetailsInternetPage.showDetailedInfo = function(data) { |
| 1056 var onc = new OncData(data); |
| 1057 |
| 999 var detailsPage = DetailsInternetPage.getInstance(); | 1058 var detailsPage = DetailsInternetPage.getInstance(); |
| 1059 detailsPage.onc_ = onc; |
| 1060 var type = onc.getActiveValue('Type'); |
| 1061 detailsPage.type_ = type; |
| 1062 detailsPage.servicePath_ = data.servicePath; |
| 1000 | 1063 |
| 1001 var onc = new OncData(data); | 1064 detailsPage.populateHeader_(); |
| 1002 data.type = onc.type; | |
| 1003 | 1065 |
| 1004 this.populateHeader(detailsPage, onc); | |
| 1005 | |
| 1006 // TODO(stevenjb): Find a more appropriate place to cache data. | |
| 1007 $('connection-state').data = data; | |
| 1008 $('connection-state').onc = onc; | |
| 1009 | |
| 1010 $('buyplan-details').hidden = true; | |
| 1011 $('activate-details').hidden = true; | 1066 $('activate-details').hidden = true; |
| 1012 $('view-account-details').hidden = true; | 1067 $('view-account-details').hidden = true; |
| 1013 | 1068 |
| 1014 this.updateConnectionButtonVisibilty(onc); | 1069 detailsPage.updateConnectionButtonVisibilty_(); |
| 1015 | 1070 |
| 1016 $('web-proxy-auto-discovery').hidden = true; | 1071 $('web-proxy-auto-discovery').hidden = true; |
| 1017 | 1072 |
| 1018 detailsPage.deviceConnected = data.deviceConnected; | 1073 detailsPage.deviceConnected = data.deviceConnected; |
| 1019 detailsPage.connected = | 1074 detailsPage.connected = |
| 1020 onc.getActiveValue('ConnectionState') == 'Connected'; | 1075 onc.getActiveValue('ConnectionState') == 'Connected'; |
| 1021 | 1076 |
| 1022 // Only show proxy for remembered networks. | 1077 // Only show proxy for remembered networks. |
| 1023 if (data.remembered) { | 1078 if (data.remembered) { |
| 1024 detailsPage.showProxy = true; | 1079 detailsPage.showProxy = true; |
| 1025 chrome.send('selectNetwork', [data.servicePath]); | 1080 chrome.send('selectNetwork', [detailsPage.servicePath_]); |
| 1026 } else { | 1081 } else { |
| 1027 detailsPage.showProxy = false; | 1082 detailsPage.showProxy = false; |
| 1028 } | 1083 } |
| 1029 | 1084 |
| 1030 var connectionStateString = onc.getTranslatedValue('ConnectionState'); | 1085 var connectionStateString = onc.getTranslatedValue('ConnectionState'); |
| 1031 $('connection-state').textContent = connectionStateString; | 1086 $('connection-state').textContent = connectionStateString; |
| 1032 var restricted = onc.getActiveValue('RestrictedConnectivity'); | 1087 var restricted = onc.getActiveValue('RestrictedConnectivity'); |
| 1033 var restrictedString = loadTimeData.getString( | 1088 var restrictedString = loadTimeData.getString( |
| 1034 restricted ? 'restrictedYes' : 'restrictedNo'); | 1089 restricted ? 'restrictedYes' : 'restrictedNo'); |
| 1035 | 1090 |
| 1036 var inetAddress = {}; | 1091 var inetAddress = {}; |
| 1037 var inetNetmask = {}; | 1092 var inetNetmask = {}; |
| 1038 var inetGateway = {}; | 1093 var inetGateway = {}; |
| 1039 | 1094 |
| 1040 var inetNameServersString; | 1095 var inetNameServersString; |
| 1041 | 1096 |
| 1042 if ('IPConfigs' in data) { | 1097 var ipconfigList = onc.getActiveValue('IPConfigs'); |
| 1043 var ipconfigList = onc.getActiveValue('IPConfigs'); | 1098 if (Array.isArray(ipconfigList)) { |
| 1044 for (var i = 0; i < ipconfigList.length; ++i) { | 1099 for (var i = 0; i < ipconfigList.length; ++i) { |
| 1045 var ipconfig = ipconfigList[i]; | 1100 var ipconfig = ipconfigList[i]; |
| 1046 var type = ipconfig['Type']; | 1101 var ipType = ipconfig['Type']; |
| 1047 if (type != 'IPv4') { | 1102 if (ipType != 'IPv4') { |
| 1048 // TODO(stevenjb): Handle IPv6 properties. | 1103 // TODO(stevenjb): Handle IPv6 properties. |
| 1049 continue; | 1104 continue; |
| 1050 } | 1105 } |
| 1051 var address = ipconfig['IPAddress']; | 1106 var address = ipconfig['IPAddress']; |
| 1052 inetAddress.automatic = address; | 1107 inetAddress.automatic = address; |
| 1053 inetAddress.value = address; | 1108 inetAddress.value = address; |
| 1054 var netmask = PrefixLengthToNetmask(ipconfig['RoutingPrefix']); | 1109 var netmask = PrefixLengthToNetmask(ipconfig['RoutingPrefix']); |
| 1055 inetNetmask.automatic = netmask; | 1110 inetNetmask.automatic = netmask; |
| 1056 inetNetmask.value = netmask; | 1111 inetNetmask.value = netmask; |
| 1057 var gateway = ipconfig['Gateway']; | 1112 var gateway = ipconfig['Gateway']; |
| 1058 inetGateway.automatic = gateway; | 1113 inetGateway.automatic = gateway; |
| 1059 inetGateway.value = gateway; | 1114 inetGateway.value = gateway; |
| 1060 if ('WebProxyAutoDiscoveryUrl' in ipconfig) { | 1115 if ('WebProxyAutoDiscoveryUrl' in ipconfig) { |
| 1061 $('web-proxy-auto-discovery').hidden = false; | 1116 $('web-proxy-auto-discovery').hidden = false; |
| 1062 $('web-proxy-auto-discovery-url').value = | 1117 $('web-proxy-auto-discovery-url').value = |
| 1063 ipconfig['WebProxyAutoDiscoveryUrl']; | 1118 ipconfig['WebProxyAutoDiscoveryUrl']; |
| 1064 } | 1119 } |
| 1065 if ('NameServers' in ipconfig) { | 1120 if ('NameServers' in ipconfig) { |
| 1066 var inetNameServers = ipconfig['NameServers']; | 1121 var inetNameServers = ipconfig['NameServers']; |
| 1067 inetNameServers = inetNameServers.sort(); | 1122 inetNameServers = inetNameServers.sort(); |
| 1068 inetNameServersString = inetNameServers.join(','); | 1123 inetNameServersString = inetNameServers.join(','); |
| 1069 } | 1124 } |
| 1070 break; // Use the first IPv4 entry. | 1125 break; // Use the first IPv4 entry. |
| 1071 } | 1126 } |
| 1072 } | 1127 } |
| 1073 | 1128 |
| 1074 // Override the "automatic" values with the real saved DHCP values, | 1129 // Override the "automatic" values with the real saved DHCP values, |
| 1075 // if they are set. | 1130 // if they are set. |
| 1076 var savedNameServersString; | 1131 var savedNameServersString; |
| 1077 if ('SavedIPConfig' in data) { | 1132 var savedIpAddress = onc.getActiveValue('SavedIPConfig.IPAddress'); |
| 1078 var savedIpAddress = onc.getActiveValue('SavedIPConfig.IPAddress'); | 1133 if (savedIpAddress != undefined) { |
| 1079 if (savedIpAddress != undefined) { | 1134 inetAddress.automatic = savedIpAddress; |
| 1080 inetAddress.automatic = savedIpAddress; | 1135 inetAddress.value = savedIpAddress; |
| 1081 inetAddress.value = savedIpAddress; | 1136 } |
| 1082 } | 1137 var savedPrefix = onc.getActiveValue('SavedIPConfig.RoutingPrefix'); |
| 1083 var savedPrefix = onc.getActiveValue('SavedIPConfig.RoutingPrefix'); | 1138 if (savedPrefix != undefined) { |
| 1084 if (savedPrefix != undefined) { | 1139 var savedNetmask = PrefixLengthToNetmask(savedPrefix); |
| 1085 var savedNetmask = PrefixLengthToNetmask(savedPrefix); | 1140 inetNetmask.automatic = savedNetmask; |
| 1086 inetNetmask.automatic = savedNetmask; | 1141 inetNetmask.value = savedNetmask; |
| 1087 inetNetmask.value = savedNetmask; | 1142 } |
| 1088 } | 1143 var savedGateway = onc.getActiveValue('SavedIPConfig.Gateway'); |
| 1089 var savedGateway = onc.getActiveValue('SavedIPConfig.Gateway'); | 1144 if (savedGateway != undefined) { |
| 1090 if (savedGateway != undefined) { | 1145 inetGateway.automatic = savedGateway; |
| 1091 inetGateway.automatic = savedGateway; | 1146 inetGateway.value = savedGateway; |
| 1092 inetGateway.value = savedGateway; | 1147 } |
| 1093 } | 1148 var savedNameServers = onc.getActiveValue('SavedIPConfig.NameServers'); |
| 1094 var savedNameServers = onc.getActiveValue('SavedIPConfig.NameServers'); | 1149 if (savedNameServers) { |
| 1095 if (savedNameServers) { | 1150 savedNameServers = savedNameServers.sort(); |
| 1096 savedNameServers = savedNameServers.sort(); | 1151 savedNameServersString = savedNameServers.join(','); |
| 1097 savedNameServersString = savedNameServers.join(','); | |
| 1098 } | |
| 1099 } | 1152 } |
| 1100 | 1153 |
| 1101 var ipAutoConfig = 'automatic'; | 1154 var ipAutoConfig = 'automatic'; |
| 1102 | 1155 |
| 1103 var staticNameServersString; | 1156 var staticNameServersString; |
| 1104 if ('StaticIPConfig' in data) { | 1157 var staticIpAddress = onc.getActiveValue('StaticIPConfig.IPAddress'); |
| 1105 var staticIpAddress = onc.getActiveValue('StaticIPConfig.IPAddress'); | 1158 if (staticIpAddress != undefined) { |
| 1106 if (staticIpAddress != undefined) { | 1159 ipAutoConfig = 'user'; |
| 1107 ipAutoConfig = 'user'; | 1160 inetAddress.user = staticIpAddress; |
| 1108 inetAddress.user = staticIpAddress; | 1161 inetAddress.value = staticIpAddress; |
| 1109 inetAddress.value = staticIpAddress; | 1162 } |
| 1110 } | 1163 var staticPrefix = onc.getActiveValue('StaticIPConfig.RoutingPrefix'); |
| 1111 var staticPrefix = onc.getActiveValue('StaticIPConfig.RoutingPrefix'); | 1164 if (staticPrefix != undefined) { |
| 1112 if (staticPrefix != undefined) { | 1165 var staticNetmask = PrefixLengthToNetmask(staticPrefix); |
| 1113 var staticNetmask = PrefixLengthToNetmask(staticPrefix); | 1166 inetNetmask.user = staticNetmask; |
| 1114 inetNetmask.user = staticNetmask; | 1167 inetNetmask.value = staticNetmask; |
| 1115 inetNetmask.value = staticNetmask; | 1168 } |
| 1116 } | 1169 var staticGateway = onc.getActiveValue('StaticIPConfig.Gateway'); |
| 1117 var staticGateway = onc.getActiveValue('StaticIPConfig.Gateway'); | 1170 if (staticGateway != undefined) { |
| 1118 if (staticGateway != undefined) { | 1171 inetGateway.user = staticGateway; |
| 1119 inetGateway.user = staticGateway; | 1172 inetGateway.value = staticGateway; |
| 1120 inetGateway.value = staticGateway; | 1173 } |
| 1121 } | 1174 var staticNameServers = onc.getActiveValue('StaticIPConfig.NameServers'); |
| 1122 var staticNameServers = onc.getActiveValue('StaticIPConfig.NameServers'); | 1175 if (staticNameServers) { |
| 1123 if (staticNameServers) { | 1176 staticNameServers = staticNameServers.sort(); |
| 1124 staticNameServers = staticNameServers.sort(); | 1177 staticNameServersString = staticNameServers.join(','); |
| 1125 staticNameServersString = staticNameServers.join(','); | |
| 1126 } | |
| 1127 } | 1178 } |
| 1128 | 1179 |
| 1129 $('ip-automatic-configuration-checkbox').checked = | 1180 $('ip-automatic-configuration-checkbox').checked = |
| 1130 ipAutoConfig == 'automatic'; | 1181 ipAutoConfig == 'automatic'; |
| 1131 | 1182 |
| 1132 inetAddress.autoConfig = ipAutoConfig; | 1183 inetAddress.autoConfig = ipAutoConfig; |
| 1133 inetNetmask.autoConfig = ipAutoConfig; | 1184 inetNetmask.autoConfig = ipAutoConfig; |
| 1134 inetGateway.autoConfig = ipAutoConfig; | 1185 inetGateway.autoConfig = ipAutoConfig; |
| 1135 | 1186 |
| 1136 var configureAddressField = function(field, model) { | 1187 var configureAddressField = function(field, model) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1185 $(field).parentElement.hidden = false; | 1236 $(field).parentElement.hidden = false; |
| 1186 } else { | 1237 } else { |
| 1187 $(field).parentElement.hidden = true; | 1238 $(field).parentElement.hidden = true; |
| 1188 } | 1239 } |
| 1189 }; | 1240 }; |
| 1190 | 1241 |
| 1191 var networkName = onc.getTranslatedValue('Name'); | 1242 var networkName = onc.getTranslatedValue('Name'); |
| 1192 | 1243 |
| 1193 // Signal strength as percentage (for WiFi and Wimax). | 1244 // Signal strength as percentage (for WiFi and Wimax). |
| 1194 var signalStrength; | 1245 var signalStrength; |
| 1195 if (onc.type == 'WiFi' || onc.type == 'Wimax') { | 1246 if (type == 'WiFi' || type == 'Wimax') |
| 1196 signalStrength = onc.getActiveValue(onc.type + '.SignalStrength'); | 1247 signalStrength = onc.getActiveValue(type + '.SignalStrength'); |
| 1197 } | |
| 1198 if (!signalStrength) | 1248 if (!signalStrength) |
| 1199 signalStrength = 0; | 1249 signalStrength = 0; |
| 1200 var strengthFormat = loadTimeData.getString('inetSignalStrengthFormat'); | 1250 var strengthFormat = loadTimeData.getString('inetSignalStrengthFormat'); |
| 1201 var strengthString = strengthFormat.replace('$1', signalStrength); | 1251 var strengthString = strengthFormat.replace('$1', signalStrength); |
| 1202 | 1252 |
| 1203 detailsPage.type = onc.type; | 1253 if (type == 'WiFi') { |
| 1204 if (onc.type == 'WiFi') { | |
| 1205 OptionsPage.showTab($('wifi-network-nav-tab')); | 1254 OptionsPage.showTab($('wifi-network-nav-tab')); |
| 1206 detailsPage.gsm = false; | 1255 detailsPage.gsm = false; |
| 1207 detailsPage.shared = data.shared; | 1256 detailsPage.shared = data.shared; |
| 1208 $('wifi-connection-state').textContent = connectionStateString; | 1257 $('wifi-connection-state').textContent = connectionStateString; |
| 1209 $('wifi-restricted-connectivity').textContent = restrictedString; | 1258 $('wifi-restricted-connectivity').textContent = restrictedString; |
| 1210 var ssid = onc.getActiveValue('WiFi.SSID'); | 1259 var ssid = onc.getActiveValue('WiFi.SSID'); |
| 1211 $('wifi-ssid').textContent = ssid ? ssid : networkName; | 1260 $('wifi-ssid').textContent = ssid ? ssid : networkName; |
| 1212 setOrHideParent('wifi-bssid', onc.getActiveValue('WiFi.BSSID')); | 1261 setOrHideParent('wifi-bssid', onc.getActiveValue('WiFi.BSSID')); |
| 1213 var security = onc.getActiveValue('WiFi.Security'); | 1262 var security = onc.getActiveValue('WiFi.Security'); |
| 1214 if (security == 'None') | 1263 if (security == 'None') |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1225 setOrHideParent('wifi-hardware-address', | 1274 setOrHideParent('wifi-hardware-address', |
| 1226 onc.getActiveValue('MacAddress')); | 1275 onc.getActiveValue('MacAddress')); |
| 1227 detailsPage.showPreferred = data.remembered; | 1276 detailsPage.showPreferred = data.remembered; |
| 1228 var priority = onc.getActiveValue('Priority'); | 1277 var priority = onc.getActiveValue('Priority'); |
| 1229 $('prefer-network-wifi').checked = priority > 0; | 1278 $('prefer-network-wifi').checked = priority > 0; |
| 1230 $('prefer-network-wifi').disabled = !data.remembered; | 1279 $('prefer-network-wifi').disabled = !data.remembered; |
| 1231 $('auto-connect-network-wifi').checked = | 1280 $('auto-connect-network-wifi').checked = |
| 1232 onc.getActiveValue('AutoConnect'); | 1281 onc.getActiveValue('AutoConnect'); |
| 1233 $('auto-connect-network-wifi').disabled = !data.remembered; | 1282 $('auto-connect-network-wifi').disabled = !data.remembered; |
| 1234 detailsPage.hasSecurity = security != undefined; | 1283 detailsPage.hasSecurity = security != undefined; |
| 1235 } else if (onc.type == 'Wimax') { | 1284 } else if (type == 'Wimax') { |
| 1236 OptionsPage.showTab($('wimax-network-nav-tab')); | 1285 OptionsPage.showTab($('wimax-network-nav-tab')); |
| 1237 detailsPage.gsm = false; | 1286 detailsPage.gsm = false; |
| 1238 detailsPage.shared = data.shared; | 1287 detailsPage.shared = data.shared; |
| 1239 detailsPage.showPreferred = data.remembered; | 1288 detailsPage.showPreferred = data.remembered; |
| 1240 $('wimax-connection-state').textContent = connectionStateString; | 1289 $('wimax-connection-state').textContent = connectionStateString; |
| 1241 $('wimax-restricted-connectivity').textContent = restrictedString; | 1290 $('wimax-restricted-connectivity').textContent = restrictedString; |
| 1242 $('auto-connect-network-wimax').checked = | 1291 $('auto-connect-network-wimax').checked = |
| 1243 onc.getActiveValue('AutoConnect'); | 1292 onc.getActiveValue('AutoConnect'); |
| 1244 $('auto-connect-network-wimax').disabled = !data.remembered; | 1293 $('auto-connect-network-wimax').disabled = !data.remembered; |
| 1245 var identity = onc.getActiveValue('Wimax.EAP.Identity'); | 1294 var identity = onc.getActiveValue('Wimax.EAP.Identity'); |
| 1246 setOrHideParent('wimax-eap-identity', identity); | 1295 setOrHideParent('wimax-eap-identity', identity); |
| 1247 $('wimax-signal-strength').textContent = strengthString; | 1296 $('wimax-signal-strength').textContent = strengthString; |
| 1248 } else if (onc.type == 'Cellular') { | 1297 } else if (type == 'Cellular') { |
| 1249 OptionsPage.showTab($('cellular-conn-nav-tab')); | 1298 OptionsPage.showTab($('cellular-conn-nav-tab')); |
| 1250 if (data.showCarrierSelect && data.currentCarrierIndex != -1) { | 1299 if (data.showCarrierSelect && data.currentCarrierIndex != -1) { |
| 1251 var carrierSelector = $('select-carrier'); | 1300 var carrierSelector = $('select-carrier'); |
| 1252 carrierSelector.onchange = DetailsInternetPage.handleCarrierChanged; | 1301 carrierSelector.onchange = DetailsInternetPage.handleCarrierChanged; |
| 1253 carrierSelector.options.length = 0; | 1302 carrierSelector.options.length = 0; |
| 1254 for (var i = 0; i < data.carriers.length; ++i) { | 1303 for (var i = 0; i < data.carriers.length; ++i) { |
| 1255 var option = document.createElement('option'); | 1304 var option = document.createElement('option'); |
| 1256 option.textContent = data.carriers[i]; | 1305 option.textContent = data.carriers[i]; |
| 1257 carrierSelector.add(option); | 1306 carrierSelector.add(option); |
| 1258 } | 1307 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1301 setOrHideParent('imei', onc.getActiveValue('Cellular.IMEI')); | 1350 setOrHideParent('imei', onc.getActiveValue('Cellular.IMEI')); |
| 1302 setOrHideParent('meid', onc.getActiveValue('Cellular.MEID')); | 1351 setOrHideParent('meid', onc.getActiveValue('Cellular.MEID')); |
| 1303 setOrHideParent('min', onc.getActiveValue('Cellular.MIN')); | 1352 setOrHideParent('min', onc.getActiveValue('Cellular.MIN')); |
| 1304 setOrHideParent('prl-version', onc.getActiveValue('Cellular.PRLVersion')); | 1353 setOrHideParent('prl-version', onc.getActiveValue('Cellular.PRLVersion')); |
| 1305 | 1354 |
| 1306 var family = onc.getActiveValue('Cellular.Family'); | 1355 var family = onc.getActiveValue('Cellular.Family'); |
| 1307 detailsPage.gsm = family == 'GSM'; | 1356 detailsPage.gsm = family == 'GSM'; |
| 1308 if (detailsPage.gsm) { | 1357 if (detailsPage.gsm) { |
| 1309 $('iccid').textContent = onc.getActiveValue('Cellular.ICCID'); | 1358 $('iccid').textContent = onc.getActiveValue('Cellular.ICCID'); |
| 1310 $('imsi').textContent = onc.getActiveValue('Cellular.IMSI'); | 1359 $('imsi').textContent = onc.getActiveValue('Cellular.IMSI'); |
| 1311 | 1360 detailsPage.initializeApnList_(onc); |
| 1312 var apnSelector = $('select-apn'); | |
| 1313 // Clear APN lists, keep only last element that "other". | |
| 1314 while (apnSelector.length != 1) | |
| 1315 apnSelector.remove(0); | |
| 1316 var otherOption = apnSelector[0]; | |
| 1317 data.selectedApn = -1; | |
| 1318 data.userApnIndex = -1; | |
| 1319 var activeApn = onc.getActiveValue('Cellular.APN.AccessPointName'); | |
| 1320 var activeUsername = onc.getActiveValue('Cellular.APN.Username'); | |
| 1321 var activePassword = onc.getActiveValue('Cellular.APN.Password'); | |
| 1322 var lastGoodApn = | |
| 1323 onc.getActiveValue('Cellular.LastGoodAPN.AccessPointName'); | |
| 1324 var lastGoodUsername = | |
| 1325 onc.getActiveValue('Cellular.LastGoodAPN.Username'); | |
| 1326 var lastGoodPassword = | |
| 1327 onc.getActiveValue('Cellular.LastGoodAPN.Password'); | |
| 1328 var apnList = onc.getActiveValue('Cellular.APNList'); | |
| 1329 for (var i = 0; i < apnList.length; i++) { | |
| 1330 var apnDict = apnList[i]; | |
| 1331 var option = document.createElement('option'); | |
| 1332 var localizedName = apnDict['LocalizedName']; | |
| 1333 var name = localizedName ? localizedName : apnDict['Name']; | |
| 1334 var accessPointName = apnDict['AccessPointName']; | |
| 1335 option.textContent = | |
| 1336 name ? (name + ' (' + accessPointName + ')') : accessPointName; | |
| 1337 option.value = i; | |
| 1338 // If this matches the active Apn, or LastGoodApn, set it as the | |
| 1339 // selected Apn. | |
| 1340 if ((activeApn == accessPointName && | |
| 1341 activeUsername == apnDict['Username'] && | |
| 1342 activePassword == apnDict['Password']) || | |
| 1343 (!activeApn && | |
| 1344 lastGoodApn == accessPointName && | |
| 1345 lastGoodUsername == apnDict['Username'] && | |
| 1346 lastGoodPassword == apnDict['Password'])) { | |
| 1347 data.selectedApn = i; | |
| 1348 } | |
| 1349 // Insert new option before "other" option. | |
| 1350 apnSelector.add(option, otherOption); | |
| 1351 } | |
| 1352 if (data.selectedApn == -1 && activeApn) { | |
| 1353 var option = document.createElement('option'); | |
| 1354 option.textContent = activeApn; | |
| 1355 option.value = -1; | |
| 1356 apnSelector.add(option, otherOption); | |
| 1357 data.selectedApn = apnSelector.length - 2; | |
| 1358 data.userApnIndex = data.selectedApn; | |
| 1359 } | |
| 1360 apnSelector.selectedIndex = data.selectedApn; | |
| 1361 updateHidden('.apn-list-view', false); | |
| 1362 updateHidden('.apn-details-view', true); | |
| 1363 var lockEnabled = | 1361 var lockEnabled = |
| 1364 onc.getActiveValue('Cellular.SIMLockStatus.LockEnabled'); | 1362 onc.getActiveValue('Cellular.SIMLockStatus.LockEnabled'); |
| 1365 $('sim-card-lock-enabled').checked = lockEnabled; | 1363 $('sim-card-lock-enabled').checked = lockEnabled; |
| 1366 $('change-pin').hidden = !lockEnabled; | 1364 $('change-pin').hidden = !lockEnabled; |
| 1367 } | 1365 } |
| 1368 $('auto-connect-network-cellular').checked = | 1366 $('auto-connect-network-cellular').checked = |
| 1369 onc.getActiveValue('AutoConnect'); | 1367 onc.getActiveValue('AutoConnect'); |
| 1370 $('auto-connect-network-cellular').disabled = false; | 1368 $('auto-connect-network-cellular').disabled = false; |
| 1371 | 1369 |
| 1372 $('buyplan-details').hidden = !data.showBuyButton; | |
| 1373 $('view-account-details').hidden = !data.showViewAccountButton; | 1370 $('view-account-details').hidden = !data.showViewAccountButton; |
| 1374 $('activate-details').hidden = !data.showActivateButton; | 1371 $('activate-details').hidden = !data.showActivateButton; |
| 1375 if (data.showActivateButton) { | 1372 if (data.showActivateButton) |
| 1376 $('details-internet-login').hidden = true; | 1373 $('details-internet-login').hidden = true; |
| 1377 } | 1374 } else if (type == 'VPN') { |
| 1378 } else if (onc.type == 'VPN') { | |
| 1379 OptionsPage.showTab($('vpn-nav-tab')); | 1375 OptionsPage.showTab($('vpn-nav-tab')); |
| 1380 detailsPage.gsm = false; | 1376 detailsPage.gsm = false; |
| 1381 $('inet-service-name').textContent = networkName; | 1377 $('inet-service-name').textContent = networkName; |
| 1382 $('inet-provider-type').textContent = | 1378 $('inet-provider-type').textContent = |
| 1383 onc.getTranslatedValue('VPN.Type'); | 1379 onc.getTranslatedValue('VPN.Type'); |
| 1384 var providerType = onc.getActiveValue('VPN.Type'); | 1380 var providerType = onc.getActiveValue('VPN.Type'); |
| 1385 var providerKey = 'VPN.' + providerType; | 1381 var providerKey = 'VPN.' + providerType; |
| 1386 $('inet-username').textContent = | 1382 $('inet-username').textContent = |
| 1387 onc.getActiveValue(providerKey + '.Username'); | 1383 onc.getActiveValue(providerKey + '.Username'); |
| 1388 var inetServerHostname = $('inet-server-hostname'); | 1384 var inetServerHostname = $('inet-server-hostname'); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1433 | 1429 |
| 1434 // Don't show page name in address bar and in history to prevent people | 1430 // Don't show page name in address bar and in history to prevent people |
| 1435 // navigate here by hand and solve issue with page session restore. | 1431 // navigate here by hand and solve issue with page session restore. |
| 1436 PageManager.showPageByName('detailsInternetPage', false); | 1432 PageManager.showPageByName('detailsInternetPage', false); |
| 1437 }; | 1433 }; |
| 1438 | 1434 |
| 1439 return { | 1435 return { |
| 1440 DetailsInternetPage: DetailsInternetPage | 1436 DetailsInternetPage: DetailsInternetPage |
| 1441 }; | 1437 }; |
| 1442 }); | 1438 }); |
| OLD | NEW |