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

Side by Side Diff: ui/webui/resources/cr_elements/network/cr_network_select.js

Issue 2640923004: CrOS WebUI: Show 'Connecting' in network list and blur selected item (Closed)
Patch Set: . Created 3 years, 11 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 /** 5 /**
6 * @fileoverview Polymer element wrapping cr-network-list including the 6 * @fileoverview Polymer element wrapping cr-network-list including the
7 * networkingPrivate calls to populate it. 7 * networkingPrivate calls to populate it.
8 */ 8 */
9 9
10 Polymer({ 10 Polymer({
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 /** 112 /**
113 * @param {!Array<!CrOnc.NetworkStateProperties>} states 113 * @param {!Array<!CrOnc.NetworkStateProperties>} states
114 * @private 114 * @private
115 */ 115 */
116 getNetworksCallback_: function(states) { 116 getNetworksCallback_: function(states) {
117 this.networkStateList_ = states; 117 this.networkStateList_ = states;
118 }, 118 },
119 119
120 /** 120 /**
121 * Event triggered when a cr-network-list-item is selected. 121 * Event triggered when a cr-network-list-item is selected.
122 * @param {!{detail: !CrOnc.NetworkStateProperties}} event 122 * @param {!{target: HTMLElement, detail: !CrOnc.NetworkStateProperties}} e
123 * @private 123 * @private
124 */ 124 */
125 onNetworkListItemSelected_: function(event) { 125 onNetworkListItemSelected_: function(e) {
126 var state = event.detail; 126 var state = e.detail;
127 e.target.blur();
127 128
128 if (!this.handleNetworkItemSelected) { 129 if (!this.handleNetworkItemSelected) {
129 this.fire('network-item-selected', state); 130 this.fire('network-item-selected', state);
130 return; 131 return;
131 } 132 }
132 133
133 if (state.ConnectionState != CrOnc.ConnectionState.NOT_CONNECTED) 134 if (state.ConnectionState != CrOnc.ConnectionState.NOT_CONNECTED)
134 return; 135 return;
135 136
136 chrome.networkingPrivate.startConnect(state.GUID, function() { 137 chrome.networkingPrivate.startConnect(state.GUID, function() {
137 var lastError = chrome.runtime.lastError; 138 var lastError = chrome.runtime.lastError;
138 if (lastError && lastError != 'connecting') 139 if (lastError && lastError != 'connecting')
139 console.error('networkingPrivate.startConnect error: ' + lastError); 140 console.error('networkingPrivate.startConnect error: ' + lastError);
140 }); 141 });
141 }, 142 },
142 }); 143 });
OLDNEW
« no previous file with comments | « ui/webui/resources/cr_elements/network/cr_network_list_item.js ('k') | ui/webui/resources/cr_elements/network/cr_onc_types.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698