Chromium Code Reviews| Index: chrome/browser/resources/net_internals/source_row.js |
| =================================================================== |
| --- chrome/browser/resources/net_internals/source_row.js (revision 112998) |
| +++ chrome/browser/resources/net_internals/source_row.js (working copy) |
| @@ -36,7 +36,7 @@ |
| createRow_: function() { |
| // Create a row. |
| var tr = addNode(this.parentView_.tableBody_, 'tr'); |
| - tr._id = this.sourceEntry_.getSourceId(); |
| + tr._id = this.getSourceId(); |
| tr.style.display = 'none'; |
| this.row_ = tr; |
| @@ -63,8 +63,8 @@ |
| tr.onmouseout = this.onMouseout_.bind(this); |
| // Set the cell values to match this source's data. |
| - if (this.sourceEntry_.getSourceId() >= 0) { |
| - addTextNode(idCell, this.sourceEntry_.getSourceId()); |
| + if (this.getSourceId() >= 0) { |
| + addTextNode(idCell, this.getSourceId()); |
| } else { |
| addTextNode(idCell, '-'); |
| } |
| @@ -179,17 +179,19 @@ |
| // Check source ID, if needed. |
| if (filter.id) { |
| - if (filter.id.indexOf(this.sourceEntry_.getSourceId() + '') == -1) |
| + if (filter.id.indexOf(this.getSourceId() + '') == -1) |
| return false; |
| } |
| if (filter.text == '') |
| return true; |
| - var filterText = filter.text; |
| - var entryText = this.sourceEntry_.printAsText().toLowerCase(); |
| + // The description is not always contained in one of the log entries. |
| + if (this.description_.toLowerCase().indexOf(filter.text) != -1) |
| + return true; |
| - return entryText.indexOf(filterText) != -1; |
| + var entryText = JSON.stringify(this.sourceEntry_.getLogEntries()); |
|
mmenke
2011/12/08 21:50:28
This doesn't work quite as well as the old code, s
|
| + return entryText.toLowerCase().indexOf(filter.text) != -1; |
| }, |
| isSelected: function() { |
| @@ -203,7 +205,7 @@ |
| this.isSelected_ = isSelected; |
| this.setSelectedStyles(isSelected); |
| - this.parentView_.modifySelectionArray(this, isSelected); |
| + this.parentView_.modifySelectionArray(this.getSourceId(), isSelected); |
| this.parentView_.onSelectionChanged(); |
| }, |
| @@ -245,6 +247,10 @@ |
| return this.row_.childNodes[0].firstChild; |
| }, |
| + getSourceId: function() { |
| + return this.sourceEntry_.getSourceId(); |
| + }, |
| + |
| /** |
| * Returns source ID of the entry whose row is currently above this one's. |
| * Returns null if no such node exists. |