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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 detailCell.colSpan = baseRow.childNodes.length - 1; | 173 detailCell.colSpan = baseRow.childNodes.length - 1; |
174 expandedRow.appendChild(detailCell); | 174 expandedRow.appendChild(detailCell); |
175 var showDetail = function(state) { | 175 var showDetail = function(state) { |
176 if (networkConfig.lastError) | 176 if (networkConfig.lastError) |
177 detailCell.textContent = networkConfig.lastError; | 177 detailCell.textContent = networkConfig.lastError; |
178 else | 178 else |
179 detailCell.textContent = JSON.stringify(state, null, '\t'); | 179 detailCell.textContent = JSON.stringify(state, null, '\t'); |
180 }; | 180 }; |
181 var selected = $('get-property-format').selectedIndex; | 181 var selected = $('get-property-format').selectedIndex; |
182 var selectedId = $('get-property-format').options[selected].value; | 182 var selectedId = $('get-property-format').options[selected].value; |
183 if (selectedId == 'shill') | 183 if (selectedId == 'shill') { |
184 networkConfig.getShillProperties(guid, showDetail); | 184 networkConfig.getShillProperties(guid, showDetail); |
185 else if (selectedId == 'managed') | 185 } else if (selectedId == 'managed') { |
186 networkConfig.getManagedProperties(guid, showDetail); | 186 chrome.networkingPrivate.getManagedProperties(guid, showDetail); |
187 else | 187 } else { |
188 networkConfig.getProperties(guid, showDetail); | 188 chrome.networkingPrivate.getProperties(guid, showDetail); |
| 189 } |
189 return expandedRow; | 190 return expandedRow; |
190 }; | 191 }; |
191 | 192 |
192 /** | 193 /** |
193 * Requests an update of all network info. | 194 * Requests an update of all network info. |
194 */ | 195 */ |
195 var requestNetworks = function() { | 196 var requestNetworks = function() { |
196 networkConfig.getNetworks( | 197 networkConfig.getNetworks( |
197 { 'type': 'All', 'visible': true }, | 198 { 'type': 'All', 'visible': true }, |
198 onVisibleNetworksReceived); | 199 onVisibleNetworksReceived); |
(...skipping 15 matching lines...) Expand all Loading... |
214 * Get network information from WebUI. | 215 * Get network information from WebUI. |
215 */ | 216 */ |
216 document.addEventListener('DOMContentLoaded', function() { | 217 document.addEventListener('DOMContentLoaded', function() { |
217 $('refresh').onclick = requestNetworks; | 218 $('refresh').onclick = requestNetworks; |
218 setRefresh(); | 219 setRefresh(); |
219 requestNetworks(); | 220 requestNetworks(); |
220 }); | 221 }); |
221 | 222 |
222 return {}; | 223 return {}; |
223 })(); | 224 })(); |
OLD | NEW |