| 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 var showDetail = function(state, error) { | 215 var showDetail = function(state, error) { |
| 216 if (error && error.message) | 216 if (error && error.message) |
| 217 detailCell.textContent = error.message; | 217 detailCell.textContent = error.message; |
| 218 else | 218 else |
| 219 detailCell.textContent = JSON.stringify(state, null, '\t'); | 219 detailCell.textContent = JSON.stringify(state, null, '\t'); |
| 220 }; | 220 }; |
| 221 var selected = $('get-property-format').selectedIndex; | 221 var selected = $('get-property-format').selectedIndex; |
| 222 var selectedId = $('get-property-format').options[selected].value; | 222 var selectedId = $('get-property-format').options[selected].value; |
| 223 if (selectedId == 'shill') { | 223 if (selectedId == 'shill') { |
| 224 chrome.send('getShillProperties', [guid]); | 224 chrome.send('getShillProperties', [guid]); |
| 225 } else if (selectedId == 'state') { |
| 226 chrome.networkingPrivate.getState(guid, function(properties) { |
| 227 showDetail(properties, chrome.runtime.lastError); }); |
| 225 } else if (selectedId == 'managed') { | 228 } else if (selectedId == 'managed') { |
| 226 chrome.networkingPrivate.getManagedProperties(guid, function(properties) { | 229 chrome.networkingPrivate.getManagedProperties(guid, function(properties) { |
| 227 showDetail(properties, chrome.runtime.lastError); }); | 230 showDetail(properties, chrome.runtime.lastError); }); |
| 228 } else { | 231 } else { |
| 229 chrome.networkingPrivate.getProperties(guid, function(properties) { | 232 chrome.networkingPrivate.getProperties(guid, function(properties) { |
| 230 showDetail(properties, chrome.runtime.lastError); }); | 233 showDetail(properties, chrome.runtime.lastError); }); |
| 231 } | 234 } |
| 232 return expandedRow; | 235 return expandedRow; |
| 233 }; | 236 }; |
| 234 | 237 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 document.addEventListener('DOMContentLoaded', function() { | 287 document.addEventListener('DOMContentLoaded', function() { |
| 285 $('refresh').onclick = requestNetworks; | 288 $('refresh').onclick = requestNetworks; |
| 286 setRefresh(); | 289 setRefresh(); |
| 287 requestNetworks(); | 290 requestNetworks(); |
| 288 }); | 291 }); |
| 289 | 292 |
| 290 return { | 293 return { |
| 291 getShillPropertiesResult: getShillPropertiesResult | 294 getShillPropertiesResult: getShillPropertiesResult |
| 292 }; | 295 }; |
| 293 })(); | 296 })(); |
| OLD | NEW |