| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 6 |
| 7 var OptionsPage = options.OptionsPage; | 7 var OptionsPage = options.OptionsPage; |
| 8 | 8 |
| 9 ///////////////////////////////////////////////////////////////////////////// | 9 ///////////////////////////////////////////////////////////////////////////// |
| 10 // InternetOptions class: | 10 // InternetOptions class: |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 [networkType, servicePath, "options"]); | 90 [networkType, servicePath, "options"]); |
| 91 } | 91 } |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 InternetOptions.loginFromDetails = function () { | 94 InternetOptions.loginFromDetails = function () { |
| 95 var data = $('inetAddress').data; | 95 var data = $('inetAddress').data; |
| 96 var servicePath = data.servicePath; | 96 var servicePath = data.servicePath; |
| 97 if (data.certinpkcs) { | 97 if (data.certinpkcs) { |
| 98 chrome.send('loginToCertNetwork',[String(servicePath), | 98 chrome.send('loginToCertNetwork',[String(servicePath), |
| 99 String(data.certPath), | 99 String(data.certPath), |
| 100 String(data.ident), | 100 String(data.ident)]); |
| 101 String(data.certPass)]); | |
| 102 } else { | 101 } else { |
| 103 chrome.send('loginToCertNetwork',[String(servicePath), | 102 chrome.send('loginToCertNetwork',[String(servicePath), |
| 104 String($('inetCert').value), | 103 String($('inetCert').value), |
| 105 String($('inetIdent').value), | 104 String($('inetIdent').value), |
| 106 String($('inetCertPass').value)]); | 105 String($('inetCertPass').value)]); |
| 107 } | 106 } |
| 108 OptionsPage.clearOverlays(); | 107 OptionsPage.clearOverlays(); |
| 109 }; | 108 }; |
| 110 | 109 |
| 111 InternetOptions.setDetails = function() { | 110 InternetOptions.setDetails = function() { |
| 112 var data = $('inetAddress').data; | 111 var data = $('inetAddress').data; |
| 113 if (data.type == 2) { | 112 if (data.type == 2) { |
| 114 var newinfo = []; | 113 var newinfo = []; |
| 115 newinfo.push(data.servicePath); | 114 newinfo.push(data.servicePath); |
| 116 newinfo.push($('rememberNetwork').checked ? "true" : "false"); | 115 newinfo.push($('rememberNetwork').checked ? "true" : "false"); |
| 117 if (data.encrypted) { | 116 if (data.encrypted && data.certNeeded) { |
| 118 if (data.certneeded) { | 117 newinfo.push($('inetIdent').value); |
| 119 newinfo.push($('inetIdent').value); | 118 newinfo.push($('inetCert').value); |
| 120 newinfo.push($('inetCert').value); | 119 newinfo.push($('inetCertPass').value); |
| 121 newinfo.push($('inetCertPass').value); | |
| 122 } else { | |
| 123 newinfo.push(''); | |
| 124 newinfo.push(''); | |
| 125 newinfo.push($('inetPass').value); | |
| 126 } | |
| 127 } | 120 } |
| 128 chrome.send('setDetails', newinfo); | 121 chrome.send('setDetails', newinfo); |
| 129 } | 122 } |
| 130 OptionsPage.clearOverlays(); | 123 OptionsPage.clearOverlays(); |
| 131 }; | 124 }; |
| 132 | 125 |
| 133 InternetOptions.setupAttributes = function(data) { | 126 InternetOptions.setupAttributes = function(data) { |
| 134 var buttons = $('wirelessButtons'); | 127 var buttons = $('wirelessButtons'); |
| 135 if (data.wifiEnabled) { | 128 if (data.wifiEnabled) { |
| 136 $('disableWifi').disabled = false; | 129 $('disableWifi').disabled = false; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 $('hardwareAddressRow').style.display = 'none'; | 229 $('hardwareAddressRow').style.display = 'none'; |
| 237 } | 230 } |
| 238 if (data.type == 2) { | 231 if (data.type == 2) { |
| 239 OptionsPage.showTab($('wifiNetworkNavTab')); | 232 OptionsPage.showTab($('wifiNetworkNavTab')); |
| 240 page.setAttribute('wireless', true); | 233 page.setAttribute('wireless', true); |
| 241 page.removeAttribute('ethernet'); | 234 page.removeAttribute('ethernet'); |
| 242 page.removeAttribute('cellular'); | 235 page.removeAttribute('cellular'); |
| 243 page.removeAttribute('gsm'); | 236 page.removeAttribute('gsm'); |
| 244 $('inetSsid').textContent = data.ssid; | 237 $('inetSsid').textContent = data.ssid; |
| 245 $('rememberNetwork').checked = data.autoConnect; | 238 $('rememberNetwork').checked = data.autoConnect; |
| 239 page.removeAttribute('password'); |
| 246 page.removeAttribute('cert'); | 240 page.removeAttribute('cert'); |
| 247 page.removeAttribute('password'); | 241 page.removeAttribute('certPkcs'); |
| 248 if (data.encrypted) { | 242 if (data.encrypted) { |
| 249 if (data.certNeeded) { | 243 if (data.certNeeded) { |
| 250 page.setAttribute('cert', true); | |
| 251 if (data.certInPkcs) { | 244 if (data.certInPkcs) { |
| 252 page.setAttribute('certPkcs', true); | 245 page.setAttribute('certPkcs', true); |
| 253 $('inetIdentPkcs').value = data.ident; | 246 $('inetIdentPkcs').value = data.ident; |
| 254 } else { | 247 } else { |
| 255 page.removeAttribute('certPkcs'); | 248 page.setAttribute('cert', true); |
| 256 $('inetIdent').value = data.ident; | 249 $('inetIdent').value = data.ident; |
| 257 $('inetCert').value = data.certPath; | 250 $('inetCert').value = data.certPath; |
| 258 $('inetCertPass').value = data.certPass; | |
| 259 } | 251 } |
| 260 } else { | 252 } else { |
| 261 page.setAttribute('password', true); | 253 page.setAttribute('password', true); |
| 262 var passfield = $('inetPass'); | |
| 263 passfield.value = data.pass; | |
| 264 passfield.type = 'password'; | |
| 265 $('inetShowPass').addEventListener('change', function(e) { | |
| 266 if ($('inetShowPass').checked) { | |
| 267 passfield.type = 'text'; | |
| 268 } else { | |
| 269 passfield.type = 'password'; | |
| 270 } | |
| 271 }); | |
| 272 } | 254 } |
| 273 } | 255 } |
| 274 } else if(data.type == 5) { | 256 } else if(data.type == 5) { |
| 275 OptionsPage.showTab($('cellularPlanNavTab')); | 257 OptionsPage.showTab($('cellularPlanNavTab')); |
| 276 page.removeAttribute('ethernet'); | 258 page.removeAttribute('ethernet'); |
| 277 page.removeAttribute('wireless'); | 259 page.removeAttribute('wireless'); |
| 278 page.removeAttribute('cert'); | 260 page.removeAttribute('cert'); |
| 279 page.removeAttribute('certPkcs'); | 261 page.removeAttribute('certPkcs'); |
| 280 page.setAttribute('cellular', true); | 262 page.setAttribute('cellular', true); |
| 281 $('serviceName').textContent = data.serviceName; | 263 $('serviceName').textContent = data.serviceName; |
| 282 $('networkTechnology').textContent = data.networkTechnology; | 264 $('networkTechnology').textContent = data.networkTechnology; |
| 283 $('activationState').textContent = data.activationState; | 265 $('activationState').textContent = data.activationState; |
| 284 $('roamingState').textContent = data.roamingState; | 266 $('roamingState').textContent = data.roamingState; |
| 285 $('restrictedPool').textContent = data.restrictedPool; | 267 $('restrictedPool').textContent = data.restrictedPool; |
| 286 $('errorState').textContent = data.errorState; | 268 $('errorState').textContent = data.errorState; |
| 269 $('customerSupport').href = data.supportUrl; |
| 287 $('manufacturer').textContent = data.manufacturer; | 270 $('manufacturer').textContent = data.manufacturer; |
| 288 $('modelId').textContent = data.modelId; | 271 $('modelId').textContent = data.modelId; |
| 289 $('firmwareRevision').textContent = data.firmwareRevision; | 272 $('firmwareRevision').textContent = data.firmwareRevision; |
| 290 $('hardwareRevision').textContent = data.hardwareRevision; | 273 $('hardwareRevision').textContent = data.hardwareRevision; |
| 291 $('lastUpdate').textContent = data.lastUpdate; | 274 $('lastUpdate').textContent = data.lastUpdate; |
| 292 $('prlVersion').textContent = data.prlVersion; | 275 $('prlVersion').textContent = data.prlVersion; |
| 293 $('meid').textContent = data.meid; | 276 $('meid').textContent = data.meid; |
| 294 $('imei').textContent = data.imei; | 277 $('imei').textContent = data.imei; |
| 295 $('mdn').textContent = data.mdn; | 278 $('mdn').textContent = data.mdn; |
| 296 $('esn').textContent = data.esn; | 279 $('esn').textContent = data.esn; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 318 } | 301 } |
| 319 OptionsPage.showOverlay('detailsInternetPage'); | 302 OptionsPage.showOverlay('detailsInternetPage'); |
| 320 }; | 303 }; |
| 321 | 304 |
| 322 // Export | 305 // Export |
| 323 return { | 306 return { |
| 324 InternetOptions: InternetOptions | 307 InternetOptions: InternetOptions |
| 325 }; | 308 }; |
| 326 | 309 |
| 327 }); | 310 }); |
| OLD | NEW |