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

Side by Side Diff: chrome/browser/resources/settings/internet_page/network_summary_item.js

Issue 2838323002: [CrOS Tether] Add tether settings section to the MD settings page. (Closed)
Patch Set: Fix Closure compiler error. Created 3 years, 7 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 for displaying the network state for a specific 6 * @fileoverview Polymer element for displaying the network state for a specific
7 * type and a list of networks for that type. 7 * type and a list of networks for that type.
8 */ 8 */
9 9
10 /** @typedef {chrome.networkingPrivate.DeviceStateProperties} */ 10 /** @typedef {chrome.networkingPrivate.DeviceStateProperties} */
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 181
182 /** 182 /**
183 * @param {!DeviceStateProperties} deviceState 183 * @param {!DeviceStateProperties} deviceState
184 * @return {string} 184 * @return {string}
185 * @private 185 * @private
186 */ 186 */
187 getToggleA11yString_: function(deviceState) { 187 getToggleA11yString_: function(deviceState) {
188 if (!this.enableToggleIsVisible_(deviceState)) 188 if (!this.enableToggleIsVisible_(deviceState))
189 return ''; 189 return '';
190 switch (deviceState.Type) { 190 switch (deviceState.Type) {
191 case CrOnc.Type.TETHER:
192 return this.i18n('internetToggleTetherA11yLabel');
191 case CrOnc.Type.CELLULAR: 193 case CrOnc.Type.CELLULAR:
192 return this.i18n('internetToggleMobileA11yLabel'); 194 return this.i18n('internetToggleMobileA11yLabel');
193 case CrOnc.Type.WI_FI: 195 case CrOnc.Type.WI_FI:
194 return this.i18n('internetToggleWiFiA11yLabel'); 196 return this.i18n('internetToggleWiFiA11yLabel');
195 case CrOnc.Type.WI_MAX: 197 case CrOnc.Type.WI_MAX:
196 return this.i18n('internetToggleWiMAXA11yLabel'); 198 return this.i18n('internetToggleWiMAXA11yLabel');
197 } 199 }
198 assertNotReached(); 200 assertNotReached();
199 return ''; 201 return '';
200 }, 202 },
201 203
202 /** 204 /**
203 * @return {boolean} 205 * @return {boolean}
204 * @private 206 * @private
205 */ 207 */
206 showDetailsIsVisible_: function() { 208 showDetailsIsVisible_: function() {
207 return this.deviceIsEnabled_(this.deviceState) && 209 return this.deviceIsEnabled_(this.deviceState) &&
208 (!!this.activeNetworkState.GUID || this.networkStateList.length > 0); 210 (!!this.activeNetworkState.GUID || this.networkStateList.length > 0);
209 }, 211 },
210 212
211 /** 213 /**
212 * @return {boolean} 214 * @return {boolean}
213 * @private 215 * @private
214 */ 216 */
215 shouldShowList_: function() { 217 shouldShowList_: function() {
216 var minlen = (this.deviceState.Type == CrOnc.Type.WI_FI || 218 var minlen = (this.deviceState.Type == CrOnc.Type.WI_FI ||
217 this.deviceState.Type == CrOnc.Type.VPN) ? 219 this.deviceState.Type == CrOnc.Type.VPN ||
220 this.deviceState.Type == CrOnc.Type.TETHER) ?
218 1 : 221 1 :
219 2; 222 2;
220 return this.networkStateList.length >= minlen; 223 return this.networkStateList.length >= minlen;
221 }, 224 },
222 225
223 /** 226 /**
224 * @param {!Event} event The enable button event. 227 * @param {!Event} event The enable button event.
225 * @private 228 * @private
226 */ 229 */
227 onShowDetailsTap_: function(event) { 230 onShowDetailsTap_: function(event) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 */ 264 */
262 onDeviceEnabledTap_: function(event) { 265 onDeviceEnabledTap_: function(event) {
263 var deviceIsEnabled = this.deviceIsEnabled_(this.deviceState); 266 var deviceIsEnabled = this.deviceIsEnabled_(this.deviceState);
264 var type = this.deviceState ? this.deviceState.Type : ''; 267 var type = this.deviceState ? this.deviceState.Type : '';
265 this.fire( 268 this.fire(
266 'device-enabled-toggled', {enabled: !deviceIsEnabled, type: type}); 269 'device-enabled-toggled', {enabled: !deviceIsEnabled, type: type});
267 // Make sure this does not propagate to onDetailsTap_. 270 // Make sure this does not propagate to onDetailsTap_.
268 event.stopPropagation(); 271 event.stopPropagation();
269 }, 272 },
270 }); 273 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698