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

Side by Side Diff: chrome/browser/resources/chromeos/network.js

Issue 23441025: Clean up NetworkState members (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 var NetworkUI = function() { 5 var NetworkUI = function() {
6 // Properties to display in the network state table 6 // Properties to display in the network state table
7 var NETWORK_STATE_FIELDS = ['Name', 'Type', 'State', 'Profile', 'Connectable', 7 var NETWORK_STATE_FIELDS = ['Name', 'Type', 'State', 'Profile', 'Connectable',
8 'Error', 'ADdress', 'Security', 'Cellular.NetworkTechnology', 8 'Error', 'Address', 'Security', 'Cellular.NetworkTechnology',
9 'Cellular.ActivationState', 'Cellular.RoamingState', 9 'Cellular.ActivationState', 'Cellular.RoamingState',
10 'Cellular.OutOfCredits', 'signalStrength', 'AutoConnect', 10 'Cellular.OutOfCredits', 'Strength'];
11 'Favorite', 'Priority'];
12 11
13 var LOG_LEVEL_CLASSNAME = { 12 var LOG_LEVEL_CLASSNAME = {
14 'Error': 'network-log-level-error', 13 'Error': 'network-log-level-error',
15 'User': 'network-log-level-user', 14 'User': 'network-log-level-user',
16 'Event': 'network-log-level-event', 15 'Event': 'network-log-level-event',
17 'Debug': 'network-log-level-debug' 16 'Debug': 'network-log-level-debug'
18 }; 17 };
19 18
20 var LOG_LEVEL_CHECKBOX = { 19 var LOG_LEVEL_CHECKBOX = {
21 'Error': 'log-error', 20 'Error': 'log-error',
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 * Create a row in the network state table. 96 * Create a row in the network state table.
98 * 97 *
99 * @param {string} path The network path. 98 * @param {string} path The network path.
100 * @param {dictionary} status Properties of the network. 99 * @param {dictionary} status Properties of the network.
101 * @return {DOMElement} The created tr element that contains the network 100 * @return {DOMElement} The created tr element that contains the network
102 * state information. 101 * state information.
103 */ 102 */
104 var createStatusTableRow = function(path, status) { 103 var createStatusTableRow = function(path, status) {
105 var row = document.createElement('tr'); 104 var row = document.createElement('tr');
106 row.className = 'network-status-table-row'; 105 row.className = 'network-status-table-row';
106 row.appendChild(createStatusTableCell(path));
107 for (var i = 0; i < NETWORK_STATE_FIELDS.length; ++i) { 107 for (var i = 0; i < NETWORK_STATE_FIELDS.length; ++i) {
108 row.appendChild(createStatusTableCell(status[NETWORK_STATE_FIELDS[i]])); 108 row.appendChild(createStatusTableCell(status[NETWORK_STATE_FIELDS[i]]));
109 } 109 }
110 row.appendChild(createStatusTableCell(path));
111 return row; 110 return row;
112 }; 111 };
113 112
114 /** 113 /**
115 * Create network state table. 114 * Create network state table.
116 * 115 *
117 * @param {Array.<Object>} networkStatuses An array of network states. 116 * @param {Array.<Object>} networkStatuses An array of network states.
118 */ 117 */
119 var createNetworkTable = function(networkStatuses) { 118 var createNetworkTable = function(networkStatuses) {
120 var table = $('network-status-table'); 119 var table = $('network-status-table');
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 $('log-fileinfo').checked = false; 168 $('log-fileinfo').checked = false;
170 $('log-fileinfo').onclick = sendRefresh; 169 $('log-fileinfo').onclick = sendRefresh;
171 setRefresh(); 170 setRefresh();
172 sendRefresh(); 171 sendRefresh();
173 }); 172 });
174 173
175 return { 174 return {
176 onNetworkInfoReceived: onNetworkInfoReceived 175 onNetworkInfoReceived: onNetworkInfoReceived
177 }; 176 };
178 }(); 177 }();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698