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

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

Issue 1277223002: Add cr-network-select element for selecting a Chrome OS network (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_515987_network_configure
Patch Set: Compile fix Created 5 years, 4 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
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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 return '_' + guid.replace(/[{}]/g, ''); 190 return '_' + guid.replace(/[{}]/g, '');
191 }; 191 };
192 192
193 /** 193 /**
194 * This callback function is triggered when visible networks are received. 194 * This callback function is triggered when visible networks are received.
195 * 195 *
196 * @param {!Array<!chrome.networkingPrivate.NetworkStateProperties>} states 196 * @param {!Array<!chrome.networkingPrivate.NetworkStateProperties>} states
197 * A list of network state information for each visible network. 197 * A list of network state information for each visible network.
198 */ 198 */
199 var onVisibleNetworksReceived = function(states) { 199 var onVisibleNetworksReceived = function(states) {
200 /** @type {chrome.networkingPrivate.NetworkStateProperties} */ var
201 defaultState;
202 if (states.length > 0)
203 defaultState = states[0];
204 var icon = /** @type {CrNetworkIconElement} */($('default-network-icon'));
205 if (defaultState && defaultState.Type != CrOnc.Type.VPN) {
206 $('default-network-text').textContent =
207 loadTimeData.getStringF('defaultNetworkText',
208 defaultState.Name,
209 defaultState.ConnectionState);
210 icon.networkState = defaultState;
211 } else {
212 $('default-network-text').textContent =
213 loadTimeData.getString('noNetworkText');
214 // Show the disconnected wifi icon if there are no networks.
215 icon.networkType = CrOnc.Type.WIFI;
216 }
217
218 createStateTable('network-state-table', NETWORK_STATE_FIELDS, states); 200 createStateTable('network-state-table', NETWORK_STATE_FIELDS, states);
219 }; 201 };
220 202
221 /** 203 /**
222 * This callback function is triggered when favorite networks are received. 204 * This callback function is triggered when favorite networks are received.
223 * 205 *
224 * @param {!Array<!chrome.networkingPrivate.NetworkStateProperties>} states 206 * @param {!Array<!chrome.networkingPrivate.NetworkStateProperties>} states
225 * A list of network state information for each favorite network. 207 * A list of network state information for each favorite network.
226 */ 208 */
227 var onFavoriteNetworksReceived = function(states) { 209 var onFavoriteNetworksReceived = function(states) {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 document.addEventListener('DOMContentLoaded', function() { 324 document.addEventListener('DOMContentLoaded', function() {
343 $('refresh').onclick = requestNetworks; 325 $('refresh').onclick = requestNetworks;
344 setRefresh(); 326 setRefresh();
345 requestNetworks(); 327 requestNetworks();
346 }); 328 });
347 329
348 return { 330 return {
349 getShillPropertiesResult: getShillPropertiesResult 331 getShillPropertiesResult: getShillPropertiesResult
350 }; 332 };
351 })(); 333 })();
OLDNEW
« no previous file with comments | « chrome/browser/resources/chromeos/network_ui/network_ui.html ('k') | chrome/browser/resources/options/browser_options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698