Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4355)

Unified Diff: chrome/browser/resources/net_internals/table_printer.js

Issue 10987030: Make about:net-internal's filters work a bit better. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Update comments, cleanup Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.

Powered by Google App Engine
This is Rietveld 408576698