| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * @unrestricted | 8 * @unrestricted |
| 9 */ | 9 */ |
| 10 Sources.JavaScriptOutlineDialog = class extends QuickOpen.FilteredListWidget.Del
egate { | 10 Sources.JavaScriptOutlineDialog = class extends QuickOpen.FilteredListWidget.Del
egate { |
| 11 /** | 11 /** |
| 12 * @param {!Workspace.UISourceCode} uiSourceCode | 12 * @param {!Workspace.UISourceCode} uiSourceCode |
| 13 * @param {function(number, number)} selectItemCallback | 13 * @param {function(number, number)} selectItemCallback |
| 14 */ | 14 */ |
| 15 constructor(uiSourceCode, selectItemCallback) { | 15 constructor(uiSourceCode, selectItemCallback) { |
| 16 super([]); | 16 super(); |
| 17 | 17 |
| 18 this._functionItems = []; | 18 this._functionItems = []; |
| 19 this._selectItemCallback = selectItemCallback; | 19 this._selectItemCallback = selectItemCallback; |
| 20 Common.formatterWorkerPool.javaScriptOutline(uiSourceCode.workingCopy(), thi
s._didBuildOutlineChunk.bind(this)); | 20 Common.formatterWorkerPool.javaScriptOutline(uiSourceCode.workingCopy(), thi
s._didBuildOutlineChunk.bind(this)); |
| 21 } | 21 } |
| 22 | 22 |
| 23 /** | 23 /** |
| 24 * @param {!Workspace.UISourceCode} uiSourceCode | 24 * @param {!Workspace.UISourceCode} uiSourceCode |
| 25 * @param {function(number, number)} selectItemCallback | 25 * @param {function(number, number)} selectItemCallback |
| 26 */ | 26 */ |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 * @param {string} promptValue | 91 * @param {string} promptValue |
| 92 */ | 92 */ |
| 93 selectItem(itemIndex, promptValue) { | 93 selectItem(itemIndex, promptValue) { |
| 94 if (itemIndex === null) | 94 if (itemIndex === null) |
| 95 return; | 95 return; |
| 96 var lineNumber = this._functionItems[itemIndex].line; | 96 var lineNumber = this._functionItems[itemIndex].line; |
| 97 if (!isNaN(lineNumber) && lineNumber >= 0) | 97 if (!isNaN(lineNumber) && lineNumber >= 0) |
| 98 this._selectItemCallback(lineNumber, this._functionItems[itemIndex].column
); | 98 this._selectItemCallback(lineNumber, this._functionItems[itemIndex].column
); |
| 99 } | 99 } |
| 100 }; | 100 }; |
| OLD | NEW |