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 Polymer element for displaying information about a network | 6 * @fileoverview Polymer element for displaying information about a network |
7 * in a list or summary based on ONC state properties. | 7 * in a list or summary based on ONC state properties. |
8 */ | 8 */ |
9 | 9 |
10 Polymer({ | 10 Polymer({ |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
94 return CrOnc.getNetworkName(network, this); | 94 return CrOnc.getNetworkName(network, this); |
95 return this.i18n('OncType' + network.Type); | 95 return this.i18n('OncType' + network.Type); |
96 }, | 96 }, |
97 | 97 |
98 /** @private */ | 98 /** @private */ |
99 isStateTextVisible_() { | 99 isStateTextVisible_() { |
100 return !!this.networkState && (!this.isListItem || this.isConnected_()); | 100 return !!this.networkState && (!this.isListItem || this.isConnected_()); |
101 }, | 101 }, |
102 | 102 |
103 /** @private */ | 103 /** @private */ |
104 isStateTextConnected_() { | 104 isStateTextConnected_() { return this.isListItem && this.isConnected_(); }, |
dschuyler
2016/12/22 19:41:40
I think these unwrapped lines can make it hard to
Dan Beam
2016/12/22 19:42:30
change ui/webui/resources/.clang-format
Dan Beam
2016/12/22 19:48:11
https://codereview.chromium.org/2603443002
| |
105 return this.isListItem && this.isConnected_(); | |
106 }, | |
107 | 105 |
108 /** | 106 /** |
109 * This only gets called for network items once networkState is set. | 107 * This only gets called for network items once networkState is set. |
110 * @private | 108 * @private |
111 */ | 109 */ |
112 getNetworkStateText_: function() { | 110 getNetworkStateText_: function() { |
113 if (!this.isStateTextVisible_()) | 111 if (!this.isStateTextVisible_()) |
114 return ''; | 112 return ''; |
115 let network = this.networkState; | 113 let network = this.networkState; |
116 if (this.isListItem) { | 114 if (this.isListItem) { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
160 * Fires a 'show-details' event with |this.networkState| as the details. | 158 * Fires a 'show-details' event with |this.networkState| as the details. |
161 * @param {Event} event | 159 * @param {Event} event |
162 * @private | 160 * @private |
163 */ | 161 */ |
164 fireShowDetails_: function(event) { | 162 fireShowDetails_: function(event) { |
165 assert(this.networkState); | 163 assert(this.networkState); |
166 this.fire('show-detail', this.networkState); | 164 this.fire('show-detail', this.networkState); |
167 event.stopPropagation(); | 165 event.stopPropagation(); |
168 }, | 166 }, |
169 }); | 167 }); |
OLD | NEW |