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

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

Issue 364883002: Replace additional network properties with ONC values (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 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 | Annotate | Revision Log
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 // NOTE(stevenjb): This code is in the process of being converted to be 5 // NOTE(stevenjb): This code is in the process of being converted to be
6 // compatible with the networkingPrivate extension API: 6 // compatible with the networkingPrivate extension API:
7 // * The network property dictionaries are being converted to use ONC values. 7 // * The network property dictionaries are being converted to use ONC values.
8 // * chrome.send calls will be replaced with an API object that simulates the 8 // * chrome.send calls will be replaced with an API object that simulates the
9 // networkingPrivate API. See network_config.js. 9 // networkingPrivate API. See network_config.js.
10 // See crbug.com/279351 for more info. 10 // See crbug.com/279351 for more info.
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 for (var i = 0; i < data.carriers.length; ++i) { 1122 for (var i = 0; i < data.carriers.length; ++i) {
1123 var option = document.createElement('option'); 1123 var option = document.createElement('option');
1124 option.textContent = data.carriers[i]; 1124 option.textContent = data.carriers[i];
1125 carrierSelector.add(option); 1125 carrierSelector.add(option);
1126 } 1126 }
1127 carrierSelector.selectedIndex = data.currentCarrierIndex; 1127 carrierSelector.selectedIndex = data.currentCarrierIndex;
1128 } else { 1128 } else {
1129 $('service-name').textContent = getNetworkName(data); 1129 $('service-name').textContent = getNetworkName(data);
1130 } 1130 }
1131 1131
1132 $('network-technology').textContent = data.networkTechnology; 1132 $('network-technology').textContent = data.Cellular.NetworkTechnology;
1133 $('activation-state').textContent = data.activationState; 1133 $('activation-state').textContent = data.activationState;
1134 $('roaming-state').textContent = data.roamingState; 1134 $('roaming-state').textContent = data.roamingState;
1135 $('restricted-pool').textContent = data.restrictedPool; 1135 $('restricted-pool').textContent = data.restrictedPool;
1136 $('error-state').textContent = data.errorState; 1136 $('error-state').textContent = data.errorState;
1137 $('manufacturer').textContent = data.cellularManufacturer; 1137 $('manufacturer').textContent = data.Cellular.Manufacturer;
1138 $('model-id').textContent = data.modelId; 1138 $('model-id').textContent = data.Cellular.ModelID;
1139 $('firmware-revision').textContent = data.firmwareRevision; 1139 $('firmware-revision').textContent = data.Cellular.FirmwareRevision;
1140 $('hardware-revision').textContent = data.hardwareRevision; 1140 $('hardware-revision').textContent = data.Cellular.HardwareRevision;
1141 $('mdn').textContent = data.mdn; 1141 $('mdn').textContent = data.Cellular.MDN;
1142 $('operator-name').textContent = data.operatorName;
1143 $('operator-code').textContent = data.operatorCode;
1144 1142
1143 // Show ServingOperator properties only if available.
1144 if (data.Cellular.ServingOperator) {
1145 $('operator-name').textContent = data.Cellular.ServingOperator.Name;
pneubeck (no reviews) 2014/07/07 09:14:26 could use the setContentOrHide function from below
stevenjb 2014/07/07 23:40:21 Logic is slightly different; these depend on wheth
1146 $('operator-code').textContent = data.Cellular.ServingOperator.Code;
1147 } else {
1148 $('operator-name').parentElement.hidden = true;
1149 $('operator-code').parentElement.hidden = true;
1150 }
1145 // Make sure that GSM/CDMA specific properties that shouldn't be hidden 1151 // Make sure that GSM/CDMA specific properties that shouldn't be hidden
1146 // are visible. 1152 // are visible.
1147 updateHidden('#details-internet-page .gsm-only', false); 1153 updateHidden('#details-internet-page .gsm-only', false);
1148 updateHidden('#details-internet-page .cdma-only', false); 1154 updateHidden('#details-internet-page .cdma-only', false);
1149 1155
1150 // Show IMEI/ESN/MEID/MIN/PRL only if they are available. 1156 // Show IMEI/ESN/MEID/MIN/PRL only if they are available.
1151 (function() { 1157 (function() {
1152 var setContentOrHide = function(property) { 1158 var setContentOrHide = function(field, value) {
1153 var value = data[property];
1154 if (value) 1159 if (value)
1155 $(property).textContent = value; 1160 $(field).textContent = value;
1156 else 1161 else
1157 $(property).parentElement.hidden = true; 1162 $(field).parentElement.hidden = true;
1158 }; 1163 };
1159 setContentOrHide('esn'); 1164 setContentOrHide('esn', data.Cellular.ESN);
1160 setContentOrHide('imei'); 1165 setContentOrHide('imei', data.Cellular.IMEI);
1161 setContentOrHide('meid'); 1166 setContentOrHide('meid', data.Cellular.MEID);
1162 setContentOrHide('min'); 1167 setContentOrHide('min', data.Cellular.MIN);
1163 setContentOrHide('prl-version'); 1168 setContentOrHide('prl-version', data.Cellular.PRLVersion);
1164 })(); 1169 })();
1165 detailsPage.gsm = data.gsm; 1170 detailsPage.gsm = data.Cellular.Family == 'GSM';
1166 if (data.gsm) { 1171 if (detailsPage.gsm) {
1167 $('iccid').textContent = stringFromValue(data.iccid); 1172 $('iccid').textContent = stringFromValue(data.Cellular.ICCID);
pneubeck (no reviews) 2014/07/07 09:14:26 stringFromValue not required here and in the next
stevenjb 2014/07/07 23:40:21 Done.
1168 $('imsi').textContent = stringFromValue(data.imsi); 1173 $('imsi').textContent = stringFromValue(data.Cellular.IMSI);
1169 1174
1170 var apnSelector = $('select-apn'); 1175 var apnSelector = $('select-apn');
1171 // Clear APN lists, keep only last element that "other". 1176 // Clear APN lists, keep only last element that "other".
1172 while (apnSelector.length != 1) 1177 while (apnSelector.length != 1)
1173 apnSelector.remove(0); 1178 apnSelector.remove(0);
1174 var otherOption = apnSelector[0]; 1179 var otherOption = apnSelector[0];
1175 data.selectedApn = -1; 1180 data.selectedApn = -1;
1176 data.userApnIndex = -1; 1181 data.userApnIndex = -1;
1177 var apnList = data.providerApnList.value; 1182 var apnList = data.providerApnList.value;
1178 for (var i = 0; i < apnList.length; i++) { 1183 for (var i = 0; i < apnList.length; i++) {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1279 1284
1280 // Don't show page name in address bar and in history to prevent people 1285 // Don't show page name in address bar and in history to prevent people
1281 // navigate here by hand and solve issue with page session restore. 1286 // navigate here by hand and solve issue with page session restore.
1282 OptionsPage.showPageByName('detailsInternetPage', false); 1287 OptionsPage.showPageByName('detailsInternetPage', false);
1283 }; 1288 };
1284 1289
1285 return { 1290 return {
1286 DetailsInternetPage: DetailsInternetPage 1291 DetailsInternetPage: DetailsInternetPage
1287 }; 1292 };
1288 }); 1293 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698