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', function() { | 5 cr.define('options', function() { |
6 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
7 const ArrayDataModel = cr.ui.ArrayDataModel; | 7 const ArrayDataModel = cr.ui.ArrayDataModel; |
8 | 8 |
9 ///////////////////////////////////////////////////////////////////////////// | 9 ///////////////////////////////////////////////////////////////////////////// |
10 // InternetOptions class: | 10 // InternetOptions class: |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 $('viewAccountDetails').hidden = !data.showViewAccountButton; | 422 $('viewAccountDetails').hidden = !data.showViewAccountButton; |
423 }; | 423 }; |
424 | 424 |
425 InternetOptions.updateSecurityTab = function(requirePin) { | 425 InternetOptions.updateSecurityTab = function(requirePin) { |
426 $('sim-card-lock-enabled').checked = requirePin; | 426 $('sim-card-lock-enabled').checked = requirePin; |
427 $('change-pin').hidden = !requirePin; | 427 $('change-pin').hidden = !requirePin; |
428 }; | 428 }; |
429 | 429 |
430 InternetOptions.showDetailedInfo = function(data) { | 430 InternetOptions.showDetailedInfo = function(data) { |
431 var detailsPage = DetailsInternetPage.getInstance(); | 431 var detailsPage = DetailsInternetPage.getInstance(); |
| 432 |
| 433 // Populate header |
| 434 $('network-details-title').textContent = data.networkName; |
| 435 var statusKey = data.connected ? 'networkConnected' : |
| 436 'networkNotConnected'; |
| 437 $('network-details-subtitle-status').textContent = |
| 438 localStrings.getString(statusKey); |
| 439 var typeKey = null; |
| 440 var Constants = options.internet.Constants; |
| 441 switch (data.type) { |
| 442 case Constants.TYPE_ETHERNET: |
| 443 typeKey = 'ethernetTitle'; |
| 444 break; |
| 445 case Constants.TYPE_WIFI: |
| 446 typeKey = 'wifiTitle'; |
| 447 break; |
| 448 case Constants.TYPE_CELLULAR: |
| 449 typeKey = 'cellularTitle'; |
| 450 break; |
| 451 case Constants.TYPE_VPN: |
| 452 typeKey = 'vpnTitle'; |
| 453 break; |
| 454 } |
| 455 var typeLabel = $('network-details-subtitle-type'); |
| 456 var typeSeparator = $('network-details-subtitle-separator'); |
| 457 if (typeKey) { |
| 458 typeLabel.textContent = localStrings.getString(typeKey); |
| 459 typeLabel.hidden = false; |
| 460 typeSeparator.hidden = false; |
| 461 } else { |
| 462 typeLabel.hidden = true; |
| 463 typeSeparator.hidden = true; |
| 464 } |
| 465 |
432 // TODO(chocobo): Is this hack to cache the data here reasonable? | 466 // TODO(chocobo): Is this hack to cache the data here reasonable? |
433 $('connectionState').data = data; | 467 $('connectionState').data = data; |
434 $('buyplanDetails').hidden = true; | 468 $('buyplanDetails').hidden = true; |
435 $('activateDetails').hidden = true; | 469 $('activateDetails').hidden = true; |
436 $('viewAccountDetails').hidden = true; | 470 $('viewAccountDetails').hidden = true; |
437 $('detailsInternetLogin').hidden = data.connected; | 471 $('detailsInternetLogin').hidden = data.connected; |
438 if (data.type == options.internet.Constants.TYPE_ETHERNET) | 472 if (data.type == options.internet.Constants.TYPE_ETHERNET) |
439 $('detailsInternetDisconnect').hidden = true; | 473 $('detailsInternetDisconnect').hidden = true; |
440 else | 474 else |
441 $('detailsInternetDisconnect').hidden = !data.connected; | 475 $('detailsInternetDisconnect').hidden = !data.connected; |
442 | 476 |
443 detailsPage.deviceConnected = data.deviceConnected; | 477 detailsPage.deviceConnected = data.deviceConnected; |
444 detailsPage.connecting = data.connecting; | 478 detailsPage.connecting = data.connecting; |
445 detailsPage.connected = data.connected; | 479 detailsPage.connected = data.connected; |
446 if (data.connected) { | |
447 $('inetTitle').textContent = localStrings.getString('inetStatus'); | |
448 } else { | |
449 $('inetTitle').textContent = localStrings.getString('inetConnect'); | |
450 } | |
451 $('connectionState').textContent = data.connectionState; | 480 $('connectionState').textContent = data.connectionState; |
452 | 481 |
453 var inetAddress = ''; | 482 var inetAddress = ''; |
454 var inetSubnetAddress = ''; | 483 var inetSubnetAddress = ''; |
455 var inetGateway = ''; | 484 var inetGateway = ''; |
456 var inetDns = ''; | 485 var inetDns = ''; |
457 $('ipTypeDHCP').checked = true; | 486 $('ipTypeDHCP').checked = true; |
458 if (data.ipconfigStatic.value) { | 487 if (data.ipconfigStatic.value) { |
459 inetAddress = data.ipconfigStatic.value.address; | 488 inetAddress = data.ipconfigStatic.value.address; |
460 inetSubnetAddress = data.ipconfigStatic.value.subnetAddress; | 489 inetSubnetAddress = data.ipconfigStatic.value.subnetAddress; |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 | 739 |
711 InternetOptions.invalidNetworkSettings = function() { | 740 InternetOptions.invalidNetworkSettings = function() { |
712 alert(localStrings.getString('invalidNetworkSettings')); | 741 alert(localStrings.getString('invalidNetworkSettings')); |
713 }; | 742 }; |
714 | 743 |
715 // Export | 744 // Export |
716 return { | 745 return { |
717 InternetOptions: InternetOptions | 746 InternetOptions: InternetOptions |
718 }; | 747 }; |
719 }); | 748 }); |
OLD | NEW |