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

Unified Diff: Source/WebCore/inspector/ContentSearchUtils.cpp

Issue 8371003: Merge 97851 - Web Inspector: Enable caseSensitive search / Regex support in advanced search. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/912/
Patch Set: Created 9 years, 2 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
« no previous file with comments | « Source/WebCore/inspector/ContentSearchUtils.h ('k') | Source/WebCore/inspector/Inspector.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/inspector/ContentSearchUtils.cpp
===================================================================
--- Source/WebCore/inspector/ContentSearchUtils.cpp (revision 98111)
+++ Source/WebCore/inspector/ContentSearchUtils.cpp (working copy)
@@ -97,9 +97,9 @@
return result;
}
-RegularExpression createSearchRegex(const String& text, bool caseSensitive, bool isRegex)
+RegularExpression createSearchRegex(const String& query, bool caseSensitive, bool isRegex)
{
- String regexSource = isRegex ? text : createSearchRegexSource(text);
+ String regexSource = isRegex ? query : createSearchRegexSource(query);
return RegularExpression(regexSource, caseSensitive ? TextCaseSensitive : TextCaseInsensitive);
}
@@ -119,11 +119,11 @@
return result;
}
-PassRefPtr<InspectorArray> searchInTextByLines(const String& query, const String& text)
+PassRefPtr<InspectorArray> searchInTextByLines(const String& text, const String& query, const bool caseSensitive, const bool isRegex)
{
RefPtr<InspectorArray> result = InspectorArray::create();
- RegularExpression regex = ContentSearchUtils::createSearchRegex(query, false, false);
+ RegularExpression regex = ContentSearchUtils::createSearchRegex(query, caseSensitive, isRegex);
Vector<pair<int, String> > matches = getRegularExpressionMatchesByLines(regex, text);
for (Vector<pair<int, String> >::const_iterator it = matches.begin(); it != matches.end(); ++it)
« no previous file with comments | « Source/WebCore/inspector/ContentSearchUtils.h ('k') | Source/WebCore/inspector/Inspector.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698