OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 * Each row in the filtered items list is backed by a SourceEntry. This | 6 * Each row in the filtered items list is backed by a SourceEntry. This |
7 * instance contains all of the data pertaining to that row, and notifies | 7 * instance contains all of the data pertaining to that row, and notifies |
8 * its parent view (the RequestsView) whenever its data changes. | 8 * its parent view (the RequestsView) whenever its data changes. |
9 * | 9 * |
10 * @constructor | 10 * @constructor |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 148 |
149 // Add a CSS classname specific to this source type (so CSS can specify | 149 // Add a CSS classname specific to this source type (so CSS can specify |
150 // different stylings for different types). | 150 // different stylings for different types). |
151 changeClassName(this.row_, "source_" + sourceTypeString, true); | 151 changeClassName(this.row_, "source_" + sourceTypeString, true); |
152 }; | 152 }; |
153 | 153 |
154 SourceEntry.prototype.getDescription = function() { | 154 SourceEntry.prototype.getDescription = function() { |
155 var e = this.getStartEntry_(); | 155 var e = this.getStartEntry_(); |
156 if (!e || e.extra_parameters == undefined) | 156 if (!e || e.extra_parameters == undefined) |
157 return ''; | 157 return ''; |
158 return JSON.stringify(e.extra_parameters); // The URL / hostname / whatever. | 158 |
| 159 switch (e.source.type) { |
| 160 case LogSourceType.URL_REQUEST: |
| 161 case LogSourceType.SOCKET_STREAM: |
| 162 return e.extra_parameters.url; |
| 163 case LogSourceType.CONNECT_JOB: |
| 164 return e.extra_parameters.group_name; |
| 165 } |
| 166 |
| 167 return ''; |
159 }; | 168 }; |
160 | 169 |
161 /** | 170 /** |
162 * Returns the starting entry for this source. Conceptually this is the | 171 * Returns the starting entry for this source. Conceptually this is the |
163 * first entry that was logged to this source. However, we skip over the | 172 * first entry that was logged to this source. However, we skip over the |
164 * TYPE_REQUEST_ALIVE entries which wrap TYPE_URL_REQUEST_START / | 173 * TYPE_REQUEST_ALIVE entries which wrap TYPE_URL_REQUEST_START / |
165 * TYPE_SOCKET_STREAM_CONNECT. | 174 * TYPE_SOCKET_STREAM_CONNECT. |
166 * | 175 * |
167 * TODO(eroman): Get rid of TYPE_REQUEST_ALIVE so this isn't necessary. | 176 * TODO(eroman): Get rid of TYPE_REQUEST_ALIVE so this isn't necessary. |
168 */ | 177 */ |
(...skipping 22 matching lines...) Expand all Loading... |
191 SourceEntry.prototype.getSourceId = function() { | 200 SourceEntry.prototype.getSourceId = function() { |
192 return this.entries_[0].source.id; | 201 return this.entries_[0].source.id; |
193 }; | 202 }; |
194 | 203 |
195 SourceEntry.prototype.remove = function() { | 204 SourceEntry.prototype.remove = function() { |
196 this.setSelected(false); | 205 this.setSelected(false); |
197 this.setIsMatchedByFilter(false); | 206 this.setIsMatchedByFilter(false); |
198 this.row_.parentNode.removeChild(this.row_); | 207 this.row_.parentNode.removeChild(this.row_); |
199 }; | 208 }; |
200 | 209 |
OLD | NEW |