| 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 | 9 |
| 9 /** | 10 /** |
| 10 * Network settings constants. These enums must match their C++ | 11 * Network settings constants. These enums must match their C++ |
| 11 * counterparts. | 12 * counterparts. |
| 12 */ | 13 */ |
| 13 function Constants() {} | 14 function Constants() {} |
| 14 | 15 |
| 15 // Network types: | 16 // Network types: |
| 16 Constants.TYPE_UNKNOWN = 0; | 17 Constants.TYPE_UNKNOWN = 0; |
| 17 Constants.TYPE_ETHERNET = 1; | 18 Constants.TYPE_ETHERNET = 1; |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 // Proxy | 246 // Proxy |
| 246 options.proxyexceptions.ProxyExceptions.decorate($('ignored-host-list')); | 247 options.proxyexceptions.ProxyExceptions.decorate($('ignored-host-list')); |
| 247 $('remove-host').addEventListener('click', | 248 $('remove-host').addEventListener('click', |
| 248 this.handleRemoveProxyExceptions_); | 249 this.handleRemoveProxyExceptions_); |
| 249 $('add-host').addEventListener('click', this.handleAddProxyException_); | 250 $('add-host').addEventListener('click', this.handleAddProxyException_); |
| 250 $('direct-proxy').addEventListener('click', this.disableManualProxy_); | 251 $('direct-proxy').addEventListener('click', this.disableManualProxy_); |
| 251 $('manual-proxy').addEventListener('click', this.enableManualProxy_); | 252 $('manual-proxy').addEventListener('click', this.enableManualProxy_); |
| 252 $('auto-proxy').addEventListener('click', this.disableManualProxy_); | 253 $('auto-proxy').addEventListener('click', this.disableManualProxy_); |
| 253 $('proxy-all-protocols').addEventListener('click', | 254 $('proxy-all-protocols').addEventListener('click', |
| 254 this.toggleSingleProxy_); | 255 this.toggleSingleProxy_); |
| 256 |
| 255 observePrefsUI($('direct-proxy')); | 257 observePrefsUI($('direct-proxy')); |
| 256 observePrefsUI($('manual-proxy')); | 258 observePrefsUI($('manual-proxy')); |
| 257 observePrefsUI($('auto-proxy')); | 259 observePrefsUI($('auto-proxy')); |
| 258 observePrefsUI($('proxy-all-protocols')); | 260 observePrefsUI($('proxy-all-protocols')); |
| 261 |
| 262 $('ip-automatic-configuration-checkbox').addEventListener('click', |
| 263 this.handleIpAutoConfig_); |
| 264 $('automatic-dns-radio').addEventListener('click', |
| 265 this.handleNameServerTypeChange_); |
| 266 $('google-dns-radio').addEventListener('click', |
| 267 this.handleNameServerTypeChange_); |
| 268 $('user-dns-radio').addEventListener('click', |
| 269 this.handleNameServerTypeChange_); |
| 259 }, | 270 }, |
| 260 | 271 |
| 261 /** | 272 /** |
| 262 * Handler for "add" event fired from userNameEdit. | 273 * Handler for "add" event fired from userNameEdit. |
| 263 * @param {Event} e Add event fired from userNameEdit. | 274 * @param {Event} e Add event fired from userNameEdit. |
| 264 * @private | 275 * @private |
| 265 */ | 276 */ |
| 266 handleAddProxyException_: function(e) { | 277 handleAddProxyException_: function(e) { |
| 267 var exception = $('new-host').value; | 278 var exception = $('new-host').value; |
| 268 $('new-host').value = ''; | 279 $('new-host').value = ''; |
| 269 | 280 |
| 270 exception = exception.trim(); | 281 exception = exception.trim(); |
| 271 if (exception) | 282 if (exception) |
| 272 $('ignored-host-list').addException(exception); | 283 $('ignored-host-list').addException(exception); |
| 273 }, | 284 }, |
| 274 | 285 |
| 275 /** | 286 /** |
| 276 * Handler for when the remove button is clicked | 287 * Handler for when the remove button is clicked |
| 277 * @param {Event} e The click event. | 288 * @param {Event} e The click event. |
| 278 * @private | 289 * @private |
| 279 */ | 290 */ |
| 280 handleRemoveProxyExceptions_: function(e) { | 291 handleRemoveProxyExceptions_: function(e) { |
| 281 var selectedItems = $('ignored-host-list').selectedItems; | 292 var selectedItems = $('ignored-host-list').selectedItems; |
| 282 for (var x = 0; x < selectedItems.length; x++) { | 293 for (var x = 0; x < selectedItems.length; x++) { |
| 283 $('ignored-host-list').removeException(selectedItems[x]); | 294 $('ignored-host-list').removeException(selectedItems[x]); |
| 284 } | 295 } |
| 285 }, | 296 }, |
| 286 | 297 |
| 287 /** | 298 /** |
| 299 * Handler for when the IP automatic configuration checkbox is clicked. |
| 300 * @param {Event} e The click event. |
| 301 * @private |
| 302 */ |
| 303 handleIpAutoConfig_: function(e) { |
| 304 var checked = $('ip-automatic-configuration-checkbox').checked; |
| 305 var fields = [$('ip-address'), $('ip-netmask'), $('ip-gateway')]; |
| 306 for (var i = 0; i < fields.length; ++i) { |
| 307 fields[i].editable = !checked; |
| 308 if (checked) { |
| 309 var model = fields[i].model; |
| 310 model.value = model.automatic; |
| 311 fields[i].model = model; |
| 312 } |
| 313 } |
| 314 if (!checked) |
| 315 $('ip-address').focus(); |
| 316 }, |
| 317 |
| 318 /** |
| 319 * Handler for when the name server selection changes. |
| 320 * @param {Event} e The click event. |
| 321 * @private |
| 322 */ |
| 323 handleNameServerTypeChange_: function(event) { |
| 324 var type = event.target.value; |
| 325 DetailsInternetPage.updateNameServerDisplay(type); |
| 326 }, |
| 327 |
| 328 /** |
| 288 * Update details page controls. | 329 * Update details page controls. |
| 289 * @private | 330 * @private |
| 290 */ | 331 */ |
| 291 updateControls: function() { | 332 updateControls: function() { |
| 292 // Only show ipconfig section if network is connected OR if nothing on | 333 // Only show ipconfig section if network is connected OR if nothing on |
| 293 // this device is connected. This is so that you can fix the ip configs | 334 // this device is connected. This is so that you can fix the ip configs |
| 294 // if you can't connect to any network. | 335 // if you can't connect to any network. |
| 295 // TODO(chocobo): Once ipconfig is moved to flimflam service objects, | 336 // TODO(chocobo): Once ipconfig is moved to flimflam service objects, |
| 296 // we need to redo this logic to allow configuration of all networks. | 337 // we need to redo this logic to allow configuration of all networks. |
| 297 $('ipconfig-section').hidden = !this.connected && this.deviceConnected; | 338 $('ipconfig-section').hidden = !this.connected && this.deviceConnected; |
| 339 $('ipconfig-dns-section').hidden = |
| 340 !this.connected && this.deviceConnected; |
| 298 | 341 |
| 299 // Network type related. | 342 // Network type related. |
| 300 updateHidden('#details-internet-page .cellular-details', !this.cellular); | 343 updateHidden('#details-internet-page .cellular-details', !this.cellular); |
| 301 updateHidden('#details-internet-page .wifi-details', !this.wireless); | 344 updateHidden('#details-internet-page .wifi-details', !this.wireless); |
| 302 updateHidden('#details-internet-page .wimax-details', !this.wimax); | 345 updateHidden('#details-internet-page .wimax-details', !this.wimax); |
| 303 updateHidden('#details-internet-page .vpn-details', !this.vpn); | 346 updateHidden('#details-internet-page .vpn-details', !this.vpn); |
| 304 updateHidden('#details-internet-page .proxy-details', !this.showProxy); | 347 updateHidden('#details-internet-page .proxy-details', !this.showProxy); |
| 305 /* Network information merged into the Wifi tab for wireless networks | 348 /* Network information merged into the Wifi tab for wireless networks |
| 306 unless the option is set for enabling a static IP configuration. */ | 349 unless the option is set for enabling a static IP configuration. */ |
| 307 updateHidden('#details-internet-page .network-details', | 350 updateHidden('#details-internet-page .network-details', |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 } else if (data.type == Constants.TYPE_WIMAX) { | 578 } else if (data.type == Constants.TYPE_WIMAX) { |
| 536 chrome.send('setAutoConnect', | 579 chrome.send('setAutoConnect', |
| 537 [String(servicePath), | 580 [String(servicePath), |
| 538 $('auto-connect-network-wimax').checked ? 'true' : 'false']); | 581 $('auto-connect-network-wimax').checked ? 'true' : 'false']); |
| 539 } else if (data.type == Constants.TYPE_CELLULAR) { | 582 } else if (data.type == Constants.TYPE_CELLULAR) { |
| 540 chrome.send('setAutoConnect', | 583 chrome.send('setAutoConnect', |
| 541 [String(servicePath), | 584 [String(servicePath), |
| 542 $('auto-connect-network-cellular').checked ? 'true' : | 585 $('auto-connect-network-cellular').checked ? 'true' : |
| 543 'false']); | 586 'false']); |
| 544 } | 587 } |
| 545 var ipConfigList = $('ip-config-list'); | 588 |
| 546 chrome.send('setIPConfig', [String(servicePath), | 589 var nameServerTypes = ['automatic', 'google', 'user']; |
| 547 $('ip-type-dhcp').checked ? 'true' : 'false', | 590 var nameServerType = 'automatic'; |
| 548 ipConfigList.dataModel.item(0).value, | 591 for (var i = 0; i < nameServerTypes.length; ++i) { |
| 549 ipConfigList.dataModel.item(1).value, | 592 if ($(nameServerTypes[i] + '-dns-radio').checked) { |
| 550 ipConfigList.dataModel.item(2).value, | 593 nameServerType = nameServerTypes[i]; |
| 551 ipConfigList.dataModel.item(3).value]); | 594 break; |
| 595 } |
| 596 } |
| 597 |
| 598 // Skip any empty values. |
| 599 var userNameServers = []; |
| 600 for (var i = 1; i <= 4; ++i) { |
| 601 var nameServerField = $('ipconfig-dns' + i); |
| 602 if (nameServerField && nameServerField.model && |
| 603 nameServerField.model.value) { |
| 604 userNameServers.push(nameServerField.model.value); |
| 605 } |
| 606 } |
| 607 |
| 608 userNameServers = userNameServers.join(','); |
| 609 |
| 610 chrome.send('setIPConfig', |
| 611 [servicePath, |
| 612 Boolean($('ip-automatic-configuration-checkbox').checked), |
| 613 $('ip-address').model.value || '', |
| 614 $('ip-netmask').model.value || '', |
| 615 $('ip-gateway').model.value || '', |
| 616 nameServerType, |
| 617 userNameServers]); |
| 552 OptionsPage.closeOverlay(); | 618 OptionsPage.closeOverlay(); |
| 553 }; | 619 }; |
| 554 | 620 |
| 621 DetailsInternetPage.updateNameServerDisplay = function(type) { |
| 622 var editable = type == 'user'; |
| 623 var fields = [$('ipconfig-dns1'), $('ipconfig-dns2'), |
| 624 $('ipconfig-dns3'), $('ipconfig-dns4')]; |
| 625 for (var i = 0; i < fields.length; ++i) { |
| 626 fields[i].editable = editable; |
| 627 } |
| 628 if (editable) |
| 629 $('ipconfig-dns1').focus(); |
| 630 |
| 631 var automaticDns = $('automatic-dns-display'); |
| 632 var googleDns = $('google-dns-display'); |
| 633 var userDns = $('user-dns-settings'); |
| 634 if (type == 'automatic') { |
| 635 automaticDns.setAttribute('selected', ''); |
| 636 googleDns.removeAttribute('selected'); |
| 637 userDns.removeAttribute('selected'); |
| 638 } |
| 639 if (type == 'google') { |
| 640 automaticDns.removeAttribute('selected'); |
| 641 googleDns.setAttribute('selected', ''); |
| 642 userDns.removeAttribute('selected'); |
| 643 } |
| 644 if (type == 'user') { |
| 645 automaticDns.removeAttribute('selected'); |
| 646 googleDns.removeAttribute('selected'); |
| 647 userDns.setAttribute('selected', ''); |
| 648 } |
| 649 }; |
| 650 |
| 555 DetailsInternetPage.showDetailedInfo = function(data) { | 651 DetailsInternetPage.showDetailedInfo = function(data) { |
| 556 var detailsPage = DetailsInternetPage.getInstance(); | 652 var detailsPage = DetailsInternetPage.getInstance(); |
| 557 | 653 |
| 558 // Populate header | 654 // Populate header |
| 559 $('network-details-title').textContent = data.networkName; | 655 $('network-details-title').textContent = data.networkName; |
| 560 var statusKey = data.connected ? 'networkConnected' : | 656 var statusKey = data.connected ? 'networkConnected' : |
| 561 'networkNotConnected'; | 657 'networkNotConnected'; |
| 562 $('network-details-subtitle-status').textContent = | 658 $('network-details-subtitle-status').textContent = |
| 563 loadTimeData.getString(statusKey); | 659 loadTimeData.getString(statusKey); |
| 564 var typeKey = null; | 660 var typeKey = null; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 else | 699 else |
| 604 $('details-internet-disconnect').hidden = !data.connected; | 700 $('details-internet-disconnect').hidden = !data.connected; |
| 605 | 701 |
| 606 detailsPage.deviceConnected = data.deviceConnected; | 702 detailsPage.deviceConnected = data.deviceConnected; |
| 607 detailsPage.connecting = data.connecting; | 703 detailsPage.connecting = data.connecting; |
| 608 detailsPage.connected = data.connected; | 704 detailsPage.connected = data.connected; |
| 609 detailsPage.showProxy = data.showProxy; | 705 detailsPage.showProxy = data.showProxy; |
| 610 detailsPage.showStaticIPConfig = data.showStaticIPConfig; | 706 detailsPage.showStaticIPConfig = data.showStaticIPConfig; |
| 611 $('connection-state').textContent = data.connectionState; | 707 $('connection-state').textContent = data.connectionState; |
| 612 | 708 |
| 613 var inetAddress = ''; | 709 var ipAutoConfig = data.ipAutoConfig ? 'automatic' : 'user'; |
| 614 var inetSubnetAddress = ''; | 710 $('ip-automatic-configuration-checkbox').checked = data.ipAutoConfig; |
| 615 var inetGateway = ''; | 711 var inetAddress = { autoConfig: ipAutoConfig }; |
| 616 var inetDns = ''; | 712 var inetNetmask = { autoConfig: ipAutoConfig }; |
| 617 $('ip-type-dhcp').checked = true; | 713 var inetGateway = { autoConfig: ipAutoConfig }; |
| 618 if (data.ipconfigStatic.value) { | 714 |
| 619 inetAddress = data.ipconfigStatic.value.address; | 715 if (data.ipconfig.value) { |
| 620 inetSubnetAddress = data.ipconfigStatic.value.subnetAddress; | 716 inetAddress.automatic = data.ipconfig.value.address; |
| 621 inetGateway = data.ipconfigStatic.value.gateway; | 717 inetAddress.value = data.ipconfig.value.address; |
| 622 inetDns = data.ipconfigStatic.value.dns; | 718 inetNetmask.automatic = data.ipconfig.value.netmask; |
| 623 $('ip-type-static').checked = true; | 719 inetNetmask.value = data.ipconfig.value.netmask; |
| 624 } else if (data.ipconfigDHCP.value) { | 720 inetGateway.automatic = data.ipconfig.value.gateway; |
| 625 inetAddress = data.ipconfigDHCP.value.address; | 721 inetGateway.value = data.ipconfig.value.gateway; |
| 626 inetSubnetAddress = data.ipconfigDHCP.value.subnetAddress; | |
| 627 inetGateway = data.ipconfigDHCP.value.gateway; | |
| 628 inetDns = data.ipconfigDHCP.value.dns; | |
| 629 } | 722 } |
| 630 | 723 |
| 631 // Hide the dhcp/static radio if needed. | 724 // Override the "automatic" values with the real saved DHCP values, |
| 632 $('ip-type-dhcp-div').hidden = !data.showStaticIPConfig; | 725 // if they are set. |
| 633 $('ip-type-static-div').hidden = !data.showStaticIPConfig; | 726 if (data.savedIP.address) { |
| 727 inetAddress.automatic = data.savedIP.address; |
| 728 inetAddress.value = data.savedIP.address; |
| 729 } |
| 730 if (data.savedIP.netmask) { |
| 731 inetNetmask.automatic = data.savedIP.netmask; |
| 732 inetNetmask.value = data.savedIP.netmask; |
| 733 } |
| 734 if (data.savedIP.gateway) { |
| 735 inetGateway.automatic = data.savedIP.gateway; |
| 736 inetGateway.value = data.savedIP.gateway; |
| 737 } |
| 634 | 738 |
| 635 var ipConfigList = $('ip-config-list'); | 739 if (ipAutoConfig == 'user') { |
| 636 options.internet.IPConfigList.decorate(ipConfigList); | 740 if (data.staticIP.value.address) { |
| 637 ipConfigList.disabled = | 741 inetAddress.value = data.staticIP.value.address; |
| 638 $('ip-type-dhcp').checked || data.ipconfigStatic.controlledBy || | 742 inetAddress.user = data.staticIP.value.address; |
| 639 !data.showStaticIPConfig; | 743 } |
| 640 ipConfigList.autoExpands = true; | 744 if (data.staticIP.value.netmask) { |
| 641 var model = new ArrayDataModel([]); | 745 inetNetmask.value = data.staticIP.value.netmask; |
| 642 model.push({ | 746 inetNetmask.user = data.staticIP.value.netmask; |
| 643 property: 'inetAddress', | 747 } |
| 644 name: loadTimeData.getString('inetAddress'), | 748 if (data.staticIP.value.gateway) { |
| 645 value: inetAddress, | 749 inetGateway.value = data.staticIP.value.gateway; |
| 646 }); | 750 inetGateway.user = data.staticIP.value.gateway; |
| 647 model.push({ | 751 } |
| 648 property: 'inetSubnetAddress', | 752 } |
| 649 name: loadTimeData.getString('inetSubnetAddress'), | |
| 650 value: inetSubnetAddress, | |
| 651 }); | |
| 652 model.push({ | |
| 653 property: 'inetGateway', | |
| 654 name: loadTimeData.getString('inetGateway'), | |
| 655 value: inetGateway, | |
| 656 }); | |
| 657 model.push({ | |
| 658 property: 'inetDns', | |
| 659 name: loadTimeData.getString('inetDns'), | |
| 660 value: inetDns, | |
| 661 }); | |
| 662 ipConfigList.dataModel = model; | |
| 663 | 753 |
| 664 $('ip-type-dhcp').addEventListener('click', function(event) { | 754 var configureAddressField = function(field, model) { |
| 665 // Disable ipConfigList and switch back to dhcp values (if any). | 755 IPAddressField.decorate(field); |
| 666 if (data.ipconfigDHCP.value) { | 756 field.model = model; |
| 667 var config = data.ipconfigDHCP.value; | 757 field.editable = (model.autoConfig == 'user'); |
| 668 ipConfigList.dataModel.item(0).value = config.address; | 758 }; |
| 669 ipConfigList.dataModel.item(1).value = config.subnetAddress; | |
| 670 ipConfigList.dataModel.item(2).value = config.gateway; | |
| 671 ipConfigList.dataModel.item(3).value = config.dns; | |
| 672 } | |
| 673 ipConfigList.dataModel.updateIndex(0); | |
| 674 ipConfigList.dataModel.updateIndex(1); | |
| 675 ipConfigList.dataModel.updateIndex(2); | |
| 676 ipConfigList.dataModel.updateIndex(3); | |
| 677 // Unselect all so we don't keep the currently selected field editable. | |
| 678 ipConfigList.selectionModel.unselectAll(); | |
| 679 ipConfigList.disabled = true; | |
| 680 }); | |
| 681 | 759 |
| 682 $('ip-type-static').addEventListener('click', function(event) { | 760 configureAddressField($('ip-address'), inetAddress); |
| 683 // Enable ipConfigList. | 761 configureAddressField($('ip-netmask'), inetNetmask); |
| 684 ipConfigList.disabled = false; | 762 configureAddressField($('ip-gateway'), inetGateway); |
| 685 ipConfigList.focus(); | 763 |
| 686 ipConfigList.selectionModel.selectedIndex = 0; | 764 if (data.ipconfig.value && data.ipconfig.value.nameServers) |
| 687 }); | 765 $('automatic-dns-display').textContent = data.ipconfig.value.nameServers; |
| 766 if (data.savedIP && data.savedIP.nameServers) |
| 767 $('automatic-dns-display').textContent = data.savedIP.nameServers; |
| 768 if (data.nameServersGoogle) |
| 769 $('google-dns-display').textContent = data.nameServersGoogle; |
| 770 var nameServersUser = []; |
| 771 if (data.staticIP.value.nameServers) |
| 772 nameServersUser = data.staticIP.value.nameServers.split(','); |
| 773 |
| 774 var nameServerModels = []; |
| 775 for (var i = 0; i < 4; ++i) |
| 776 nameServerModels.push({ value: nameServersUser[i] || '' }); |
| 777 |
| 778 $(data.nameServerType + '-dns-radio').checked = true; |
| 779 configureAddressField($('ipconfig-dns1'), nameServerModels[0]); |
| 780 configureAddressField($('ipconfig-dns2'), nameServerModels[1]); |
| 781 configureAddressField($('ipconfig-dns3'), nameServerModels[2]); |
| 782 configureAddressField($('ipconfig-dns4'), nameServerModels[3]); |
| 783 |
| 784 DetailsInternetPage.updateNameServerDisplay(data.nameServerType); |
| 688 | 785 |
| 689 if (data.hardwareAddress) { | 786 if (data.hardwareAddress) { |
| 690 $('hardware-address').textContent = data.hardwareAddress; | 787 $('hardware-address').textContent = data.hardwareAddress; |
| 691 $('hardware-address-row').style.display = 'table-row'; | 788 $('hardware-address-row').style.display = 'table-row'; |
| 692 } else { | 789 } else { |
| 693 // This is most likely a device without a hardware address. | 790 // This is most likely a device without a hardware address. |
| 694 $('hardware-address-row').style.display = 'none'; | 791 $('hardware-address-row').style.display = 'none'; |
| 695 } | 792 } |
| 696 if (data.type == Constants.TYPE_WIFI) { | 793 if (data.type == Constants.TYPE_WIFI) { |
| 697 OptionsPage.showTab($('wifi-network-nav-tab')); | 794 OptionsPage.showTab($('wifi-network-nav-tab')); |
| 698 detailsPage.wireless = true; | 795 detailsPage.wireless = true; |
| 699 detailsPage.vpn = false; | 796 detailsPage.vpn = false; |
| 700 detailsPage.ethernet = false; | 797 detailsPage.ethernet = false; |
| 701 detailsPage.cellular = false; | 798 detailsPage.cellular = false; |
| 702 detailsPage.gsm = false; | 799 detailsPage.gsm = false; |
| 703 detailsPage.wimax = false; | 800 detailsPage.wimax = false; |
| 704 detailsPage.shared = data.shared; | 801 detailsPage.shared = data.shared; |
| 705 $('wifi-connection-state').textContent = data.connectionState; | 802 $('wifi-connection-state').textContent = data.connectionState; |
| 706 $('wifi-ssid').textContent = data.ssid; | 803 $('wifi-ssid').textContent = data.ssid; |
| 707 if (data.bssid && data.bssid.length > 0) { | 804 if (data.bssid && data.bssid.length > 0) { |
| 708 $('wifi-bssid').textContent = data.bssid; | 805 $('wifi-bssid').textContent = data.bssid; |
| 709 $('wifi-bssid-entry').hidden = false; | 806 $('wifi-bssid-entry').hidden = false; |
| 710 } else { | 807 } else { |
| 711 $('wifi-bssid-entry').hidden = true; | 808 $('wifi-bssid-entry').hidden = true; |
| 712 } | 809 } |
| 713 $('wifi-ip-address').textContent = inetAddress; | 810 $('wifi-ip-address').textContent = inetAddress; |
| 714 $('wifi-subnet-address').textContent = inetSubnetAddress; | 811 $('wifi-netmask').textContent = inetNetmask; |
| 715 $('wifi-gateway').textContent = inetGateway; | 812 $('wifi-gateway').textContent = inetGateway; |
| 716 $('wifi-dns').textContent = inetDns; | 813 $('wifi-name-servers').textContent = inetNameServers; |
| 717 if (data.encryption && data.encryption.length > 0) { | 814 if (data.encryption && data.encryption.length > 0) { |
| 718 $('wifi-security').textContent = data.encryption; | 815 $('wifi-security').textContent = data.encryption; |
| 719 $('wifi-security-entry').hidden = false; | 816 $('wifi-security-entry').hidden = false; |
| 720 } else { | 817 } else { |
| 721 $('wifi-security-entry').hidden = true; | 818 $('wifi-security-entry').hidden = true; |
| 722 } | 819 } |
| 723 // Frequency is in MHz. | 820 // Frequency is in MHz. |
| 724 var frequency = loadTimeData.getString('inetFrequencyFormat'); | 821 var frequency = loadTimeData.getString('inetFrequencyFormat'); |
| 725 frequency = frequency.replace('$1', data.frequency); | 822 frequency = frequency.replace('$1', data.frequency); |
| 726 $('wifi-frequency').textContent = frequency; | 823 $('wifi-frequency').textContent = frequency; |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 904 | 1001 |
| 905 // Don't show page name in address bar and in history to prevent people | 1002 // Don't show page name in address bar and in history to prevent people |
| 906 // navigate here by hand and solve issue with page session restore. | 1003 // navigate here by hand and solve issue with page session restore. |
| 907 OptionsPage.showPageByName('detailsInternetPage', false); | 1004 OptionsPage.showPageByName('detailsInternetPage', false); |
| 908 }; | 1005 }; |
| 909 | 1006 |
| 910 return { | 1007 return { |
| 911 DetailsInternetPage: DetailsInternetPage | 1008 DetailsInternetPage: DetailsInternetPage |
| 912 }; | 1009 }; |
| 913 }); | 1010 }); |
| OLD | NEW |