| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 var SourceRow = (function() { | 5 var SourceRow = (function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * A SourceRow represents the row corresponding to a single SourceEntry | 9 * A SourceRow represents the row corresponding to a single SourceEntry |
| 10 * displayed by the EventsView. | 10 * displayed by the EventsView. |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 return false; | 170 return false; |
| 171 if (filter.isInactive && !this.isInactive_) | 171 if (filter.isInactive && !this.isInactive_) |
| 172 return false; | 172 return false; |
| 173 if (filter.isError && !this.isError_) | 173 if (filter.isError && !this.isError_) |
| 174 return false; | 174 return false; |
| 175 if (filter.isNotError && this.isError_) | 175 if (filter.isNotError && this.isError_) |
| 176 return false; | 176 return false; |
| 177 | 177 |
| 178 // Check source type, if needed. | 178 // Check source type, if needed. |
| 179 if (filter.type) { | 179 if (filter.type) { |
| 180 var i; |
| 180 var sourceType = this.sourceEntry_.getSourceTypeString().toLowerCase(); | 181 var sourceType = this.sourceEntry_.getSourceTypeString().toLowerCase(); |
| 181 if (filter.type.indexOf(sourceType) == -1) | 182 for (i = 0; i < filter.type.length; ++i) { |
| 183 if (sourceType.search(filter.type[i]) != -1) |
| 184 break; |
| 185 } |
| 186 if (i == filter.type.length) |
| 182 return false; | 187 return false; |
| 183 } | 188 } |
| 184 | 189 |
| 185 // Check source ID, if needed. | 190 // Check source ID, if needed. |
| 186 if (filter.id) { | 191 if (filter.id) { |
| 187 if (filter.id.indexOf(this.getSourceId() + '') == -1) | 192 if (filter.id.indexOf(this.getSourceId() + '') == -1) |
| 188 return false; | 193 return false; |
| 189 } | 194 } |
| 190 | 195 |
| 191 if (filter.text == '') | 196 if (filter.text == '') |
| 192 return true; | 197 return true; |
| 193 | 198 |
| 194 // The description is not always contained in one of the log entries. | 199 // The description is not always contained in one of the log entries. |
| 195 if (this.description_.toLowerCase().indexOf(filter.text) != -1) | 200 if (this.description_.toLowerCase().indexOf(filter.text) != -1) |
| 196 return true; | 201 return true; |
| 197 | 202 |
| 198 // Allow specifying source types by name. | 203 // Allow specifying source types by name. |
| 199 var sourceType = this.sourceEntry_.getSourceTypeString(); | 204 var sourceType = this.sourceEntry_.getSourceTypeString(); |
| 200 if (sourceType.toLowerCase().indexOf(filter.text) != -1) | 205 if (sourceType.toLowerCase().indexOf(filter.text) != -1) |
| 201 return true; | 206 return true; |
| 202 | 207 |
| 203 var entryText = JSON.stringify(this.sourceEntry_.getLogEntries()); | 208 return searchLogEntriesForText( |
| 204 return entryText.toLowerCase().indexOf(filter.text) != -1; | 209 filter.text, |
| 210 this.sourceEntry_.getLogEntries(), |
| 211 SourceTracker.getInstance().getPrivacyStripping()); |
| 205 }, | 212 }, |
| 206 | 213 |
| 207 isSelected: function() { | 214 isSelected: function() { |
| 208 return this.isSelected_; | 215 return this.isSelected_; |
| 209 }, | 216 }, |
| 210 | 217 |
| 211 setSelected: function(isSelected) { | 218 setSelected: function(isSelected) { |
| 212 if (isSelected == this.isSelected()) | 219 if (isSelected == this.isSelected()) |
| 213 return; | 220 return; |
| 214 | 221 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 /** | 304 /** |
| 298 * Moves current object's row after |entry|'s row. | 305 * Moves current object's row after |entry|'s row. |
| 299 */ | 306 */ |
| 300 moveAfter: function(entry) { | 307 moveAfter: function(entry) { |
| 301 this.row_.parentNode.insertBefore(this.row_, entry.row_.nextSibling); | 308 this.row_.parentNode.insertBefore(this.row_, entry.row_.nextSibling); |
| 302 } | 309 } |
| 303 }; | 310 }; |
| 304 | 311 |
| 305 return SourceRow; | 312 return SourceRow; |
| 306 })(); | 313 })(); |
| OLD | NEW |