Skip to content

Commit

Permalink
DevTools: split FilteredItemSelectionDialog into FilteredListWidget, …
Browse files Browse the repository at this point in the history
…its UISourceCode delegate and embedders.

BUG=569457

Review URL: https://codereview.chromium.org/1561613003

Cr-Commit-Position: refs/heads/master@{#368000}
  • Loading branch information
pavelfeldman authored and Commit bot committed Jan 7, 2016
1 parent 1c92cab commit 81392bf
Show file tree
Hide file tree
Showing 17 changed files with 1,043 additions and 1,038 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
var scorer = new WebInspector.FilePathScoreFunction(query);
var bestScore = -1;
var bestIndex = -1;
var filter = WebInspector.FilePathScoreFunction.filterRegex(query);
var filter = WebInspector.FilteredListWidget.filterRegex(query);
for(var i = 0; i < paths.length; ++i) {
if (!filter.test(paths[i]))
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

function StubDelegate()
{
WebInspector.SelectionDialogContentProvider.call(this, history);
WebInspector.FilteredListWidget.Delegate.call(this, history);
}
StubDelegate.prototype = {
itemKeyAt: function(itemIndex) { return overridenInput[itemIndex]; },
Expand All @@ -25,7 +25,7 @@
},
shouldShowMatchingItems: function() { return overrideShowMatchingItems; },

__proto__: WebInspector.SelectionDialogContentProvider.prototype
__proto__: WebInspector.FilteredListWidget.Delegate.prototype
}

var delegate = new StubDelegate();
Expand All @@ -37,7 +37,8 @@

InspectorTest.addResult("Input:" + JSON.stringify(input));

var filteredSelectionDialog = new WebInspector.FilteredItemSelectionDialog(delegate);
var filteredSelectionDialog = new WebInspector.FilteredListWidget(delegate);
filteredSelectionDialog.showAsDialog();
InspectorTest.addSniffer(filteredSelectionDialog, "_autocompletedForTests", onautocomplete);
filteredSelectionDialog.setQuery(query);
filteredSelectionDialog._updateAfterItemsLoaded();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<script>
function test()
{
var delegate = new WebInspector.SelectUISourceCodeDialog();
var delegate = new WebInspector.FilteredUISourceCodeListDelegate();

InspectorTest.runTestSuite([
function testRenderingInNameOnly(next)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Loaded modules:
common
components
components_lazy
diff
elements
emulation
extensions
Expand Down
7 changes: 5 additions & 2 deletions third_party/WebKit/Source/devtools/devtools.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,6 @@
],
'devtools_sources_js_files': [
'front_end/sources/addSourceMapURLDialog.css',
'front_end/sources/filteredItemSelectionDialog.css',
'front_end/sources/navigatorView.css',
'front_end/sources/revisionHistory.css',
'front_end/sources/serviceWorkersSidebar.css',
Expand All @@ -639,13 +638,15 @@
'front_end/sources/EventListenerBreakpointsSidebarPane.js',
'front_end/sources/FileBasedSearchResultsPane.js',
'front_end/sources/FilePathScoreFunction.js',
'front_end/sources/FilteredItemSelectionDialog.js',
'front_end/sources/FilteredUISourceCodeListDelegate.js',
'front_end/sources/InplaceFormatterEditorAction.js',
'front_end/sources/JavaScriptBreakpointsSidebarPane.js',
'front_end/sources/JavaScriptCompiler.js',
'front_end/sources/JavaScriptOutlineDialog.js',
'front_end/sources/JavaScriptSourceFrame.js',
'front_end/sources/NavigatorView.js',
'front_end/sources/ObjectEventListenersSidebarPane.js',
'front_end/sources/OpenResourceDialog.js',
'front_end/sources/RevisionHistoryView.js',
'front_end/sources/ScopeChainSidebarPane.js',
'front_end/sources/ScriptFormatter.js',
Expand Down Expand Up @@ -699,11 +700,13 @@
],
'devtools_ui_lazy_js_files': [
'front_end/ui_lazy/dataGrid.css',
'front_end/ui_lazy/filteredListWidget.css',
'front_end/ui_lazy/flameChart.css',
'front_end/ui_lazy/overviewGrid.css',
'front_end/ui_lazy/pieChart.css',
'front_end/ui_lazy/timelineGrid.css',
'front_end/ui_lazy/DataGrid.js',
'front_end/ui_lazy/FilteredListWidget.js',
'front_end/ui_lazy/FlameChart.js',
'front_end/ui_lazy/OverviewGrid.js',
'front_end/ui_lazy/PieChart.js',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -554,10 +554,6 @@ body.inactive .sidebar-tree-item.selected {
bottom: 0;
}

.viewport-control-gap-element {
color: transparent;
}

.drawer-toolbar {
margin-right: -6px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,6 @@ WebInspector.FilePathScoreFunction = function(query)
this._fileNameIndex = 0;
}

/**
* @param {string} query
* @return {!RegExp}
*/
WebInspector.FilePathScoreFunction.filterRegex = function(query)
{
const toEscape = String.regexSpecialCharacters();
var regexString = "";
for (var i = 0; i < query.length; ++i) {
var c = query.charAt(i);
if (toEscape.indexOf(c) !== -1)
c = "\\" + c;
if (i)
regexString += "[^" + c + "]*";
regexString += c;
}
return new RegExp(regexString, "i");
}

WebInspector.FilePathScoreFunction.prototype = {
/**
* @param {string} data
Expand Down
Loading

0 comments on commit 81392bf

Please sign in to comment.