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

Unified Diff: Source/devtools/front_end/sources/SourcesView.js

Issue 658403002: DevTools: Support regex search and case sensitive search in sources panel (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed tests Created 6 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
Index: Source/devtools/front_end/sources/SourcesView.js
diff --git a/Source/devtools/front_end/sources/SourcesView.js b/Source/devtools/front_end/sources/SourcesView.js
index c5c5813fa33ad51eb7d1a168d3223a4498ac7928..3c2938a06ab3627f751548fadf0e8da9631d7db9 100644
--- a/Source/devtools/front_end/sources/SourcesView.js
+++ b/Source/devtools/front_end/sources/SourcesView.js
@@ -21,7 +21,7 @@ WebInspector.SourcesView = function(workspace, sourcesPanel)
this._workspace = workspace;
this._sourcesPanel = sourcesPanel;
- this._searchableView = new WebInspector.SearchableView(this);
+ this._searchableView = new WebInspector.SearchableView(this, "sourcesViewSearchConfig");
this._searchableView.setMinimalSearchQuerySize(0);
this._searchableView.show(this.element);
@@ -497,15 +497,15 @@ WebInspector.SourcesView.prototype = {
this._searchView.searchCanceled();
delete this._searchView;
- delete this._searchQuery;
+ delete this._searchConfig;
},
/**
- * @param {string} query
+ * @param {!WebInspector.SearchableView.SearchConfig} searchConfig
* @param {boolean} shouldJump
* @param {boolean=} jumpBackwards
*/
- performSearch: function(query, shouldJump, jumpBackwards)
+ performSearch: function(searchConfig, shouldJump, jumpBackwards)
{
this._searchableView.updateSearchMatchesCount(0);
@@ -514,7 +514,7 @@ WebInspector.SourcesView.prototype = {
return;
this._searchView = sourceFrame;
- this._searchQuery = query;
+ this._searchConfig = searchConfig;
/**
* @param {!WebInspector.View} view
@@ -543,10 +543,10 @@ WebInspector.SourcesView.prototype = {
*/
function searchResultsChanged()
{
- this.performSearch(query, false, false);
+ this.performSearch(this._searchConfig, false, false);
}
- this._searchView.performSearch(query, shouldJump, !!jumpBackwards, finishedCallback.bind(this), currentMatchChanged.bind(this), searchResultsChanged.bind(this));
+ this._searchView.performSearch(this._searchConfig, shouldJump, !!jumpBackwards, finishedCallback.bind(this), currentMatchChanged.bind(this), searchResultsChanged.bind(this));
},
jumpToNextSearchResult: function()
@@ -555,7 +555,7 @@ WebInspector.SourcesView.prototype = {
return;
if (this._searchView !== this.currentSourceFrame()) {
- this.performSearch(this._searchQuery, true);
+ this.performSearch(this._searchConfig, true);
return;
}
@@ -568,7 +568,7 @@ WebInspector.SourcesView.prototype = {
return;
if (this._searchView !== this.currentSourceFrame()) {
- this.performSearch(this._searchQuery, true);
+ this.performSearch(this._searchConfig, true);
if (this._searchView)
this._searchView.jumpToLastSearchResult();
return;
@@ -578,30 +578,46 @@ WebInspector.SourcesView.prototype = {
},
/**
- * @param {string} text
+ * @return {boolean}
+ */
+ supportsCaseSensitiveSearch: function()
+ {
+ return true;
+ },
+
+ /**
+ * @return {boolean}
+ */
+ supportsRegexSearch: function()
+ {
+ return true;
+ },
+
+ /**
+ * @param {string} replacement
*/
- replaceSelectionWith: function(text)
+ replaceSelectionWith: function(replacement)
{
var sourceFrame = this.currentSourceFrame();
if (!sourceFrame) {
console.assert(sourceFrame);
return;
}
- sourceFrame.replaceSelectionWith(text);
+ sourceFrame.replaceSelectionWith(replacement);
},
/**
- * @param {string} query
- * @param {string} text
+ * @param {!WebInspector.SearchableView.SearchConfig} searchConfig
+ * @param {string} replacement
*/
- replaceAllWith: function(query, text)
+ replaceAllWith: function(searchConfig, replacement)
{
var sourceFrame = this.currentSourceFrame();
if (!sourceFrame) {
console.assert(sourceFrame);
return;
}
- sourceFrame.replaceAllWith(query, text);
+ sourceFrame.replaceAllWith(searchConfig, replacement);
},
/**
« no previous file with comments | « Source/devtools/front_end/source_frame/SourceFrame.js ('k') | Source/devtools/front_end/timeline/TimelinePanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698