OLD | NEW |
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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 'configured': true}, | 312 'configured': true}, |
313 onFavoriteNetworksReceived); | 313 onFavoriteNetworksReceived); |
314 }; | 314 }; |
315 | 315 |
316 /** | 316 /** |
317 * Requests the global policy dictionary and updates the page. | 317 * Requests the global policy dictionary and updates the page. |
318 */ | 318 */ |
319 var requestGlobalPolicy = function() { | 319 var requestGlobalPolicy = function() { |
320 chrome.networkingPrivate.getGlobalPolicy(function(policy) { | 320 chrome.networkingPrivate.getGlobalPolicy(function(policy) { |
321 document.querySelector('#global-policy').textContent = | 321 document.querySelector('#global-policy').textContent = |
322 JSON.stringify(policy); | 322 JSON.stringify(policy, null, '\t'); |
323 }); | 323 }); |
324 }; | 324 }; |
325 | 325 |
326 /** | 326 /** |
327 * Sets refresh rate if the interval is found in the url. | 327 * Sets refresh rate if the interval is found in the url. |
328 */ | 328 */ |
329 var setRefresh = function() { | 329 var setRefresh = function() { |
330 var interval = parseQueryParams(window.location)['refresh']; | 330 var interval = parseQueryParams(window.location)['refresh']; |
331 if (interval && interval != '') | 331 if (interval && interval != '') |
332 setInterval(requestNetworks, parseInt(interval, 10) * 1000); | 332 setInterval(requestNetworks, parseInt(interval, 10) * 1000); |
(...skipping 15 matching lines...) Expand all Loading... |
348 }); | 348 }); |
349 | 349 |
350 document.addEventListener('custom-item-selected', function(event) { | 350 document.addEventListener('custom-item-selected', function(event) { |
351 chrome.send('addNetwork', [event.detail.customData]); | 351 chrome.send('addNetwork', [event.detail.customData]); |
352 }); | 352 }); |
353 | 353 |
354 return { | 354 return { |
355 getShillPropertiesResult: getShillPropertiesResult | 355 getShillPropertiesResult: getShillPropertiesResult |
356 }; | 356 }; |
357 })(); | 357 })(); |
OLD | NEW |