Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Side by Side Diff: chrome/browser/resources/options/chromeos/internet_detail.js

Issue 571123002: Fix some properties on the settings page read from ONC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after
1300 var frequencyFormat = loadTimeData.getString('inetFrequencyFormat'); 1300 var frequencyFormat = loadTimeData.getString('inetFrequencyFormat');
1301 frequencyFormat = frequencyFormat.replace('$1', frequency); 1301 frequencyFormat = frequencyFormat.replace('$1', frequency);
1302 $('wifi-frequency').textContent = frequencyFormat; 1302 $('wifi-frequency').textContent = frequencyFormat;
1303 $('wifi-signal-strength').textContent = strengthString; 1303 $('wifi-signal-strength').textContent = strengthString;
1304 setOrHideParent('wifi-hardware-address', 1304 setOrHideParent('wifi-hardware-address',
1305 onc.getActiveValue('MacAddress')); 1305 onc.getActiveValue('MacAddress'));
1306 var priority = onc.getActiveValue('Priority'); 1306 var priority = onc.getActiveValue('Priority');
1307 $('prefer-network-wifi').checked = priority > 0; 1307 $('prefer-network-wifi').checked = priority > 0;
1308 $('prefer-network-wifi').disabled = !remembered; 1308 $('prefer-network-wifi').disabled = !remembered;
1309 $('auto-connect-network-wifi').checked = 1309 $('auto-connect-network-wifi').checked =
1310 onc.getActiveValue('AutoConnect'); 1310 onc.getActiveValue('WiFi.AutoConnect');
1311 $('auto-connect-network-wifi').disabled = !remembered; 1311 $('auto-connect-network-wifi').disabled = !remembered;
1312 } else if (type == 'Wimax') { 1312 } else if (type == 'Wimax') {
1313 OptionsPage.showTab($('wimax-network-nav-tab')); 1313 OptionsPage.showTab($('wimax-network-nav-tab'));
1314 $('wimax-restricted-connectivity').textContent = restrictedString; 1314 $('wimax-restricted-connectivity').textContent = restrictedString;
1315 $('auto-connect-network-wimax').checked = 1315
1316 onc.getActiveValue('AutoConnect'); 1316 // ONC does not support Wimax properties, yet.
1317 $('auto-connect-network-wimax').disabled = !remembered; 1317 $('auto-connect-network-wimax').parentElement.hidden = true;
1318 var identity = onc.getActiveValue('Wimax.EAP.Identity'); 1318 // $('auto-connect-network-wimax').checked =
1319 // onc.getActiveValue('Wimax.AutoConnect');
1320 // $('auto-connect-network-wimax').disabled = !remembered;
1321 var identity; // = onc.getActiveValue('Wimax.EAP.Identity');
stevenjb 2014/09/15 16:38:41 Do we actually need to remove this? The code shoul
pneubeck (no reviews) 2014/09/15 20:27:13 As discussed this should already handle it gracefu
1319 setOrHideParent('wimax-eap-identity', identity); 1322 setOrHideParent('wimax-eap-identity', identity);
1320 $('wimax-signal-strength').textContent = strengthString; 1323 $('wimax-signal-strength').textContent = strengthString;
1321 } else if (type == 'Cellular') { 1324 } else if (type == 'Cellular') {
1322 OptionsPage.showTab($('cellular-conn-nav-tab')); 1325 OptionsPage.showTab($('cellular-conn-nav-tab'));
1323 if (data.showCarrierSelect && data.currentCarrierIndex != -1) { 1326 if (data.showCarrierSelect && data.currentCarrierIndex != -1) {
1324 var carrierSelector = $('select-carrier'); 1327 var carrierSelector = $('select-carrier');
1325 carrierSelector.onchange = DetailsInternetPage.handleCarrierChanged; 1328 carrierSelector.onchange = DetailsInternetPage.handleCarrierChanged;
1326 carrierSelector.options.length = 0; 1329 carrierSelector.options.length = 0;
1327 for (var i = 0; i < data.carriers.length; ++i) { 1330 for (var i = 0; i < data.carriers.length; ++i) {
1328 var option = document.createElement('option'); 1331 var option = document.createElement('option');
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1373 setOrHideParent('meid', onc.getActiveValue('Cellular.MEID')); 1376 setOrHideParent('meid', onc.getActiveValue('Cellular.MEID'));
1374 setOrHideParent('min', onc.getActiveValue('Cellular.MIN')); 1377 setOrHideParent('min', onc.getActiveValue('Cellular.MIN'));
1375 setOrHideParent('prl-version', onc.getActiveValue('Cellular.PRLVersion')); 1378 setOrHideParent('prl-version', onc.getActiveValue('Cellular.PRLVersion'));
1376 1379
1377 if (onc.getActiveValue('Cellular.Family') == 'GSM') { 1380 if (onc.getActiveValue('Cellular.Family') == 'GSM') {
1378 $('iccid').textContent = onc.getActiveValue('Cellular.ICCID'); 1381 $('iccid').textContent = onc.getActiveValue('Cellular.ICCID');
1379 $('imsi').textContent = onc.getActiveValue('Cellular.IMSI'); 1382 $('imsi').textContent = onc.getActiveValue('Cellular.IMSI');
1380 detailsPage.initializeApnList_(onc); 1383 detailsPage.initializeApnList_(onc);
1381 } 1384 }
1382 $('auto-connect-network-cellular').checked = 1385 $('auto-connect-network-cellular').checked =
1383 onc.getActiveValue('AutoConnect'); 1386 onc.getActiveValue('Cellular.AutoConnect');
1384 $('auto-connect-network-cellular').disabled = false; 1387 $('auto-connect-network-cellular').disabled = false;
1385 } else if (type == 'VPN') { 1388 } else if (type == 'VPN') {
1386 OptionsPage.showTab($('vpn-nav-tab')); 1389 OptionsPage.showTab($('vpn-nav-tab'));
1387 $('inet-service-name').textContent = networkName; 1390 $('inet-service-name').textContent = networkName;
1388 $('inet-provider-type').textContent = 1391 $('inet-provider-type').textContent =
1389 onc.getTranslatedValue('VPN.Type'); 1392 onc.getTranslatedValue('VPN.Type');
1390 var providerType = onc.getActiveValue('VPN.Type'); 1393 var providerType = onc.getActiveValue('VPN.Type');
1391 var providerKey = 'VPN.' + providerType; 1394 var usernameKey;
1392 $('inet-username').textContent = 1395 if (providerType == 'OpenVPN')
1393 onc.getActiveValue(providerKey + '.Username'); 1396 usernameKey = 'VPN.OpenVPN.Username';
1397 else if (providerType == 'L2TP-IPsec')
1398 usernameKey = 'VPN.L2TP.Username';
1399
1400 if (usernameKey) {
1401 $('inet-username').parentElement.hidden = false;
1402 $('inet-username').textContent = onc.getActiveValue(usernameKey);
1403 } else {
1404 $('inet-username').parentElement.hidden = true;
1405 }
1394 var inetServerHostname = $('inet-server-hostname'); 1406 var inetServerHostname = $('inet-server-hostname');
1395 inetServerHostname.value = onc.getActiveValue('VPN.Host'); 1407 inetServerHostname.value = onc.getActiveValue('VPN.Host');
1396 inetServerHostname.resetHandler = function() { 1408 inetServerHostname.resetHandler = function() {
1397 PageManager.hideBubble(); 1409 PageManager.hideBubble();
1398 var recommended = onc.getRecommendedValue('VPN.Host'); 1410 var recommended = onc.getRecommendedValue('VPN.Host');
1399 if (recommended != undefined) 1411 if (recommended != undefined)
1400 inetServerHostname.value = recommended; 1412 inetServerHostname.value = recommended;
1401 }; 1413 };
1402 $('auto-connect-network-vpn').checked = 1414 $('auto-connect-network-vpn').checked =
1403 onc.getActiveValue('AutoConnect'); 1415 onc.getActiveValue('VPN.AutoConnect');
1404 $('auto-connect-network-vpn').disabled = false; 1416 $('auto-connect-network-vpn').disabled = false;
1405 } else { 1417 } else {
1406 OptionsPage.showTab($('internet-nav-tab')); 1418 OptionsPage.showTab($('internet-nav-tab'));
1407 } 1419 }
1408 1420
1409 // Update controlled option indicators. 1421 // Update controlled option indicators.
1410 var indicators = cr.doc.querySelectorAll( 1422 var indicators = cr.doc.querySelectorAll(
1411 '#details-internet-page .controlled-setting-indicator'); 1423 '#details-internet-page .controlled-setting-indicator');
1412 for (var i = 0; i < indicators.length; i++) { 1424 for (var i = 0; i < indicators.length; i++) {
1413 var managed = indicators[i].hasAttribute('managed'); 1425 var managed = indicators[i].hasAttribute('managed');
(...skipping 25 matching lines...) Expand all
1439 1451
1440 // Don't show page name in address bar and in history to prevent people 1452 // Don't show page name in address bar and in history to prevent people
1441 // navigate here by hand and solve issue with page session restore. 1453 // navigate here by hand and solve issue with page session restore.
1442 PageManager.showPageByName('detailsInternetPage', false); 1454 PageManager.showPageByName('detailsInternetPage', false);
1443 }; 1455 };
1444 1456
1445 return { 1457 return {
1446 DetailsInternetPage: DetailsInternetPage 1458 DetailsInternetPage: DetailsInternetPage
1447 }; 1459 };
1448 }); 1460 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698