Chromium Code Reviews| Index: chrome/browser/resources/net_internals/table_printer.js |
| =================================================================== |
| --- chrome/browser/resources/net_internals/table_printer.js (revision 158398) |
| +++ chrome/browser/resources/net_internals/table_printer.js (working copy) |
| @@ -111,6 +111,27 @@ |
| }, |
| /** |
| + * Returns true if searchString can be found entirely within a cell. |
| + * Case insensitive. |
| + * |
| + * @param {string} string String to search for, must be lowercase. |
| + * @return {boolean} True if some cell contains searchString. |
| + */ |
| + search: function(searchString) { |
| + var numColumns = this.getNumColumns(); |
| + for (var r = 0; r < this.rows_.length; ++r) { |
| + for (var c = 0; c < numColumns; ++c) { |
| + var cell = this.getCell_(r, c); |
| + if (!cell) |
| + continue; |
| + if (cell.text.toLowerCase().indexOf(searchString) >= 0) |
|
eroman
2012/09/25 19:59:21
[optional] i prefer != -1
mmenke
2012/09/25 20:12:24
Done.
|
| + return true; |
| + } |
| + } |
| + return false; |
| + }, |
| + |
| + /** |
| * Prints a formatted text representation of the table data to the |
| * node |parent|. |spacing| indicates number of extra spaces, if any, |
| * to add between columns. |