Commit 61a02a63 authored by pfeldman's avatar pfeldman Committed by Commit bot

DevTools: do not subscribe to global object events from the widgets that are...

DevTools: do not subscribe to global object events from the widgets that are not necessarily disposed.

Review-Url: https://codereview.chromium.org/2615753003
Cr-Commit-Position: refs/heads/master@{#441767}
parent 0767a17e
...@@ -27,7 +27,8 @@ Sources.OpenResourceDialog = class extends Sources.FilteredUISourceCodeListDeleg ...@@ -27,7 +27,8 @@ Sources.OpenResourceDialog = class extends Sources.FilteredUISourceCodeListDeleg
*/ */
static show(sourcesView, query, defaultScores, history) { static show(sourcesView, query, defaultScores, history) {
var dialog = new Sources.OpenResourceDialog(sourcesView, defaultScores, history); var dialog = new Sources.OpenResourceDialog(sourcesView, defaultScores, history);
Sources.OpenResourceDialog._instanceForTest = dialog; if (InspectorFrontendHost.isUnderTest())
Sources.OpenResourceDialog._instanceForTest = dialog;
var filteredItemSelectionDialog = new UI.FilteredListWidget(dialog); var filteredItemSelectionDialog = new UI.FilteredListWidget(dialog);
filteredItemSelectionDialog.showAsDialog(); filteredItemSelectionDialog.showAsDialog();
filteredItemSelectionDialog.setQuery(query); filteredItemSelectionDialog.setQuery(query);
......
...@@ -120,7 +120,6 @@ UI.TextPrompt = class extends Common.Object { ...@@ -120,7 +120,6 @@ UI.TextPrompt = class extends Common.Object {
this._element.addEventListener('mousewheel', this._boundOnMouseWheel, false); this._element.addEventListener('mousewheel', this._boundOnMouseWheel, false);
this._element.addEventListener('selectstart', this._boundClearAutocomplete, false); this._element.addEventListener('selectstart', this._boundClearAutocomplete, false);
this._element.addEventListener('blur', this._boundClearAutocomplete, false); this._element.addEventListener('blur', this._boundClearAutocomplete, false);
this._element.ownerDocument.defaultView.addEventListener('resize', this._boundClearAutocomplete, false);
this._suggestBox = new UI.SuggestBox(this, 20, true); this._suggestBox = new UI.SuggestBox(this, 20, true);
...@@ -209,7 +208,6 @@ UI.TextPrompt = class extends Common.Object { ...@@ -209,7 +208,6 @@ UI.TextPrompt = class extends Common.Object {
this._element.removeEventListener('input', this._boundOnInput, false); this._element.removeEventListener('input', this._boundOnInput, false);
this._element.removeEventListener('selectstart', this._boundClearAutocomplete, false); this._element.removeEventListener('selectstart', this._boundClearAutocomplete, false);
this._element.removeEventListener('blur', this._boundClearAutocomplete, false); this._element.removeEventListener('blur', this._boundClearAutocomplete, false);
this._element.ownerDocument.defaultView.removeEventListener('resize', this._boundClearAutocomplete, false);
if (this._isEditing) if (this._isEditing)
this._stopEditing(); this._stopEditing();
if (this._suggestBox) if (this._suggestBox)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment