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

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

Issue 13725016: about:net-internals: Add support for negative text filters (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix Created 7 years, 8 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/source_row.js
===================================================================
--- chrome/browser/resources/net_internals/source_row.js (revision 194509)
+++ chrome/browser/resources/net_internals/source_row.js (working copy)
@@ -91,7 +91,7 @@
this.updateDescription_();
// Update filters.
- var matchesFilter = this.matchesFilter(this.parentView_.currentFilter_);
+ var matchesFilter = this.parentView_.currentFilter_(this.sourceEntry_);
this.setIsMatchedByFilter(matchesFilter);
},
@@ -165,63 +165,6 @@
}
},
- matchesFilter: function(filter) {
- if (filter.isActive && this.isInactive_)
- return false;
- if (filter.isInactive && !this.isInactive_)
- return false;
- if (filter.isError && !this.isError_)
- return false;
- if (filter.isNotError && this.isError_)
- return false;
-
- // Check source type, if needed.
- if (filter.type) {
- var i;
- var sourceType = this.sourceEntry_.getSourceTypeString().toLowerCase();
- for (i = 0; i < filter.type.length; ++i) {
- if (sourceType.search(filter.type[i]) != -1)
- break;
- }
- if (i == filter.type.length)
- return false;
- }
-
- // Check source ID, if needed.
- if (filter.id) {
- if (filter.id.indexOf(this.getSourceId() + '') == -1)
- return false;
- }
-
- if (!filter.textFilters)
- return true;
-
- // Used for searching for input strings. Lazily initialized.
- var tablePrinter = null;
-
- for (var i = 0; i < filter.textFilters.length; ++i) {
- // The description is not always contained in one of the log entries.
- if (this.description_.toLowerCase().indexOf(
- filter.textFilters[i]) != -1) {
- continue;
- }
-
- // Allow specifying source types by name.
- var sourceType = this.sourceEntry_.getSourceTypeString();
- if (sourceType.toLowerCase().indexOf(filter.textFilters[i]) != -1)
- continue;
-
- if (!tablePrinter) {
- tablePrinter = createLogEntryTablePrinter(
- this.sourceEntry_.getLogEntries(),
- SourceTracker.getInstance().getPrivacyStripping());
- }
- if (!tablePrinter.search(filter.textFilters[i]))
- return false;
- }
- return true;
- },
-
isSelected: function() {
return this.isSelected_;
},
« no previous file with comments | « chrome/browser/resources/net_internals/source_filter_parser.js ('k') | chrome/test/data/webui/net_internals/events_view.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698