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

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: 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..7377389b9d575404cbc14da0344e01c9d050606c 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,16 +497,17 @@ 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)
{
+ var query = searchConfig.query;
lushnikov 2014/10/20 13:09:19 query is not used
this._searchableView.updateSearchMatchesCount(0);
var sourceFrame = this.currentSourceFrame();
@@ -514,7 +515,7 @@ WebInspector.SourcesView.prototype = {
return;
this._searchView = sourceFrame;
- this._searchQuery = query;
+ this._searchConfig = searchConfig;
/**
* @param {!WebInspector.View} view
@@ -543,10 +544,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 +556,7 @@ WebInspector.SourcesView.prototype = {
return;
if (this._searchView !== this.currentSourceFrame()) {
- this.performSearch(this._searchQuery, true);
+ this.performSearch(this._searchConfig, true);
return;
}
@@ -568,7 +569,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 +579,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);
},
/**

Powered by Google App Engine
This is Rietveld 408576698