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

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: Rebase 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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1131 for (var i = 0; i < data.carriers.length; ++i) { 1131 for (var i = 0; i < data.carriers.length; ++i) {
1132 var option = document.createElement('option'); 1132 var option = document.createElement('option');
1133 option.textContent = data.carriers[i]; 1133 option.textContent = data.carriers[i];
1134 carrierSelector.add(option); 1134 carrierSelector.add(option);
1135 } 1135 }
1136 carrierSelector.selectedIndex = data.currentCarrierIndex; 1136 carrierSelector.selectedIndex = data.currentCarrierIndex;
1137 } else { 1137 } else {
1138 $('service-name').textContent = getNetworkName(data); 1138 $('service-name').textContent = getNetworkName(data);
1139 } 1139 }
1140 1140
1141 $('network-technology').textContent = data.networkTechnology; 1141 $('network-technology').textContent = data.Cellular.NetworkTechnology;
1142 $('activation-state').textContent = data.activationState; 1142 $('activation-state').textContent = data.activationState;
1143 $('roaming-state').textContent = data.roamingState; 1143 $('roaming-state').textContent = data.roamingState;
1144 $('restricted-pool').textContent = data.restrictedPool; 1144 $('restricted-pool').textContent = data.restrictedPool;
1145 $('error-state').textContent = data.errorState; 1145 $('error-state').textContent = data.errorState;
1146 $('manufacturer').textContent = data.cellularManufacturer; 1146 $('manufacturer').textContent = data.Cellular.Manufacturer;
1147 $('model-id').textContent = data.modelId; 1147 $('model-id').textContent = data.Cellular.ModelID;
1148 $('firmware-revision').textContent = data.firmwareRevision; 1148 $('firmware-revision').textContent = data.Cellular.FirmwareRevision;
1149 $('hardware-revision').textContent = data.hardwareRevision; 1149 $('hardware-revision').textContent = data.Cellular.HardwareRevision;
1150 $('mdn').textContent = data.mdn; 1150 $('mdn').textContent = data.Cellular.MDN;
1151 $('operator-name').textContent = data.operatorName;
1152 $('operator-code').textContent = data.operatorCode;
1153 1151
1152 // Show ServingOperator properties only if available.
1153 if (data.Cellular.ServingOperator) {
1154 $('operator-name').textContent = data.Cellular.ServingOperator.Name;
1155 $('operator-code').textContent = data.Cellular.ServingOperator.Code;
1156 } else {
1157 $('operator-name').parentElement.hidden = true;
1158 $('operator-code').parentElement.hidden = true;
1159 }
1154 // Make sure that GSM/CDMA specific properties that shouldn't be hidden 1160 // Make sure that GSM/CDMA specific properties that shouldn't be hidden
1155 // are visible. 1161 // are visible.
1156 updateHidden('#details-internet-page .gsm-only', false); 1162 updateHidden('#details-internet-page .gsm-only', false);
1157 updateHidden('#details-internet-page .cdma-only', false); 1163 updateHidden('#details-internet-page .cdma-only', false);
1158 1164
1159 // Show IMEI/ESN/MEID/MIN/PRL only if they are available. 1165 // Show IMEI/ESN/MEID/MIN/PRL only if they are available.
1160 (function() { 1166 (function() {
1161 var setContentOrHide = function(property) { 1167 var setContentOrHide = function(field, value) {
1162 var value = data[property];
1163 if (value) 1168 if (value)
1164 $(property).textContent = value; 1169 $(field).textContent = value;
1165 else 1170 else
1166 $(property).parentElement.hidden = true; 1171 $(field).parentElement.hidden = true;
1167 }; 1172 };
1168 setContentOrHide('esn'); 1173 setContentOrHide('esn', data.Cellular.ESN);
1169 setContentOrHide('imei'); 1174 setContentOrHide('imei', data.Cellular.IMEI);
1170 setContentOrHide('meid'); 1175 setContentOrHide('meid', data.Cellular.MEID);
1171 setContentOrHide('min'); 1176 setContentOrHide('min', data.Cellular.MIN);
1172 setContentOrHide('prl-version'); 1177 setContentOrHide('prl-version', data.Cellular.PRLVersion);
1173 })(); 1178 })();
1174 detailsPage.gsm = data.gsm; 1179 detailsPage.gsm = data.Cellular.Family == 'GSM';
1175 if (data.gsm) { 1180 if (detailsPage.gsm) {
1176 $('iccid').textContent = stringFromValue(data.iccid); 1181 $('iccid').textContent = data.Cellular.ICCID;
1177 $('imsi').textContent = stringFromValue(data.imsi); 1182 $('imsi').textContent = data.Cellular.IMSI;
1178 1183
1179 var apnSelector = $('select-apn'); 1184 var apnSelector = $('select-apn');
1180 // Clear APN lists, keep only last element that "other". 1185 // Clear APN lists, keep only last element that "other".
1181 while (apnSelector.length != 1) 1186 while (apnSelector.length != 1)
1182 apnSelector.remove(0); 1187 apnSelector.remove(0);
1183 var otherOption = apnSelector[0]; 1188 var otherOption = apnSelector[0];
1184 data.selectedApn = -1; 1189 data.selectedApn = -1;
1185 data.userApnIndex = -1; 1190 data.userApnIndex = -1;
1186 var apnList = data.providerApnList.value; 1191 var apnList = data.providerApnList.value;
1187 for (var i = 0; i < apnList.length; i++) { 1192 for (var i = 0; i < apnList.length; i++) {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1288 1293
1289 // Don't show page name in address bar and in history to prevent people 1294 // Don't show page name in address bar and in history to prevent people
1290 // navigate here by hand and solve issue with page session restore. 1295 // navigate here by hand and solve issue with page session restore.
1291 OptionsPage.showPageByName('detailsInternetPage', false); 1296 OptionsPage.showPageByName('detailsInternetPage', false);
1292 }; 1297 };
1293 1298
1294 return { 1299 return {
1295 DetailsInternetPage: DetailsInternetPage 1300 DetailsInternetPage: DetailsInternetPage
1296 }; 1301 };
1297 }); 1302 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698