| OLD | NEW |
| 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 | 6 * @fileoverview |
| 7 * 'settings-internet-detail' is the settings subpage containing details | 7 * 'settings-internet-detail' is the settings subpage containing details |
| 8 * for a network. | 8 * for a network. |
| 9 */ | 9 */ |
| 10 (function() { | 10 (function() { |
| 11 'use strict'; | 11 'use strict'; |
| 12 | 12 |
| 13 /** @const */ var CARRIER_VERIZON = 'Verizon Wireless'; | 13 /** @const */ var CARRIER_VERIZON = 'Verizon Wireless'; |
| 14 | 14 |
| 15 Polymer({ | 15 Polymer({ |
| 16 is: 'settings-internet-detail-page', | 16 is: 'settings-internet-detail-page', |
| 17 | 17 |
| 18 behaviors: [CrPolicyNetworkBehavior, settings.RouteObserverBehavior], | 18 behaviors: |
| 19 [CrPolicyNetworkBehavior, settings.RouteObserverBehavior, I18nBehavior], |
| 19 | 20 |
| 20 properties: { | 21 properties: { |
| 21 /** The network GUID to display details for. */ | 22 /** The network GUID to display details for. */ |
| 22 guid: String, | 23 guid: String, |
| 23 | 24 |
| 24 /** | 25 /** |
| 25 * The current properties for the network matching |guid|. | 26 * The current properties for the network matching |guid|. |
| 26 * @type {!CrOnc.NetworkProperties|undefined} | 27 * @type {!CrOnc.NetworkProperties|undefined} |
| 27 */ | 28 */ |
| 28 networkProperties: { | 29 networkProperties: { |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 getStateName_: function() { | 244 getStateName_: function() { |
| 244 return /** @type {string} */ ( | 245 return /** @type {string} */ ( |
| 245 CrOnc.getActiveValue(this.networkProperties.Name) || ''); | 246 CrOnc.getActiveValue(this.networkProperties.Name) || ''); |
| 246 }, | 247 }, |
| 247 | 248 |
| 248 /** | 249 /** |
| 249 * @return {string} The text to display for the network connection state. | 250 * @return {string} The text to display for the network connection state. |
| 250 * @private | 251 * @private |
| 251 */ | 252 */ |
| 252 getStateText_: function() { | 253 getStateText_: function() { |
| 253 // TODO(stevenjb): Localize. | 254 return this.i18n('Onc' + this.networkProperties.ConnectionState); |
| 254 return (this.networkProperties && this.networkProperties.ConnectionState) || | |
| 255 ''; | |
| 256 }, | 255 }, |
| 257 | 256 |
| 258 /** | 257 /** |
| 259 * @return {boolean} True if the network is connected. | 258 * @return {boolean} True if the network is connected. |
| 260 * @private | 259 * @private |
| 261 */ | 260 */ |
| 262 isConnectedState_: function() { | 261 isConnectedState_: function() { |
| 263 return this.networkProperties.ConnectionState == | 262 return this.networkProperties.ConnectionState == |
| 264 CrOnc.ConnectionState.CONNECTED; | 263 CrOnc.ConnectionState.CONNECTED; |
| 265 }, | 264 }, |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 */ | 742 */ |
| 744 allPropertiesMatch_: function(curValue, newValue) { | 743 allPropertiesMatch_: function(curValue, newValue) { |
| 745 for (let key in newValue) { | 744 for (let key in newValue) { |
| 746 if (newValue[key] != curValue[key]) | 745 if (newValue[key] != curValue[key]) |
| 747 return false; | 746 return false; |
| 748 } | 747 } |
| 749 return true; | 748 return true; |
| 750 } | 749 } |
| 751 }); | 750 }); |
| 752 })(); | 751 })(); |
| OLD | NEW |