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

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

Issue 289383004: Merge FavoriteState into NetworkState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Elim UpdateManagerProperties, feedback Created 6 years, 6 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 'use strict'; 6 'use strict';
7 7
8 // Properties to display in the network state table. Each entry can be either 8 // Properties to display in the network state table. Each entry can be either
9 // a single state field or an array of state fields. If more than one is 9 // a single state field or an array of state fields. If more than one is
10 // specified then the first non empty value is used. 10 // specified then the first non empty value is used.
(...skipping 10 matching lines...) Expand all
21 'Cellular.RoamingState', 21 'Cellular.RoamingState',
22 'Cellular.OutOfCredits', 22 'Cellular.OutOfCredits',
23 'WiFi.SignalStrength' 23 'WiFi.SignalStrength'
24 ]; 24 ];
25 25
26 var FAVORITE_STATE_FIELDS = [ 26 var FAVORITE_STATE_FIELDS = [
27 'GUID', 27 'GUID',
28 'Name', 28 'Name',
29 'Type', 29 'Type',
30 'Profile', 30 'Profile',
31 'visible',
31 'onc_source' 32 'onc_source'
32 ]; 33 ];
33 34
34 var LOG_LEVEL_CLASSNAME = { 35 var LOG_LEVEL_CLASSNAME = {
35 'Error': 'network-log-level-error', 36 'Error': 'network-log-level-error',
36 'User': 'network-log-level-user', 37 'User': 'network-log-level-user',
37 'Event': 'network-log-level-event', 38 'Event': 'network-log-level-event',
38 'Debug': 'network-log-level-debug' 39 'Debug': 'network-log-level-debug'
39 }; 40 };
40 41
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 chrome.send('NetworkUI.getNetworkLog'); 270 chrome.send('NetworkUI.getNetworkLog');
270 }; 271 };
271 272
272 /** 273 /**
273 * Requests an update of all network info. 274 * Requests an update of all network info.
274 */ 275 */
275 var requestNetworks = function() { 276 var requestNetworks = function() {
276 networkConfig.getNetworks( 277 networkConfig.getNetworks(
277 { 'type': 'All', 'visible': true }, 278 { 'type': 'All', 'visible': true },
278 onVisibleNetworksReceived); 279 onVisibleNetworksReceived);
280 // TODO(stevenjb): Only request configured networks and remove 'visible'.
279 networkConfig.getNetworks( 281 networkConfig.getNetworks(
280 { 'type': 'All', 'configured': true }, 282 { 'type': 'All', 'configured': false },
281 onFavoriteNetworksReceived); 283 onFavoriteNetworksReceived);
282 }; 284 };
283 285
284 /** 286 /**
285 * Sets refresh rate if the interval is found in the url. 287 * Sets refresh rate if the interval is found in the url.
286 */ 288 */
287 var setRefresh = function() { 289 var setRefresh = function() {
288 var interval = parseQueryParams(window.location)['refresh']; 290 var interval = parseQueryParams(window.location)['refresh'];
289 if (interval && interval != '') 291 if (interval && interval != '')
290 setInterval(requestNetworks, parseInt(interval) * 1000); 292 setInterval(requestNetworks, parseInt(interval) * 1000);
(...skipping 18 matching lines...) Expand all
309 $('log-timedetail').onclick = requestLog; 311 $('log-timedetail').onclick = requestLog;
310 setRefresh(); 312 setRefresh();
311 requestLog(); 313 requestLog();
312 requestNetworks(); 314 requestNetworks();
313 }); 315 });
314 316
315 return { 317 return {
316 getNetworkLogCallback: getNetworkLogCallback 318 getNetworkLogCallback: getNetworkLogCallback
317 }; 319 };
318 })(); 320 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698