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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sources/StyleSheetOutlineDialog.js

Issue 2736853002: DevTools: Convert FilteredListWidget to use an optional provider (Closed)
Patch Set: missing timeout Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 10 *
(...skipping 11 matching lines...) Expand all
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29 /** 29 /**
30 * @unrestricted 30 * @unrestricted
31 */ 31 */
32 Sources.StyleSheetOutlineDialog = class extends QuickOpen.FilteredListWidget.Del egate { 32 Sources.StyleSheetOutlineDialog = class extends QuickOpen.FilteredListWidget.Pro vider {
33 /** 33 /**
34 * @param {!Workspace.UISourceCode} uiSourceCode 34 * @param {!Workspace.UISourceCode} uiSourceCode
35 * @param {function(number, number)} selectItemCallback 35 * @param {function(number, number)} selectItemCallback
36 */ 36 */
37 constructor(uiSourceCode, selectItemCallback) { 37 constructor(uiSourceCode, selectItemCallback) {
38 super(); 38 super();
39 this._selectItemCallback = selectItemCallback; 39 this._selectItemCallback = selectItemCallback;
40 /** @type {!Array<!Common.FormatterWorkerPool.CSSRule>} */ 40 /** @type {!Array<!Common.FormatterWorkerPool.CSSRule>} */
41 this._rules = []; 41 this._rules = [];
42 Common.formatterWorkerPool.parseCSS(uiSourceCode.workingCopy(), (isLastChunk , rules) => { 42 Common.formatterWorkerPool.parseCSS(uiSourceCode.workingCopy(), (isLastChunk , rules) => {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 */ 105 */
106 selectItem(itemIndex, promptValue) { 106 selectItem(itemIndex, promptValue) {
107 if (itemIndex === null) 107 if (itemIndex === null)
108 return; 108 return;
109 var rule = this._rules[itemIndex]; 109 var rule = this._rules[itemIndex];
110 var lineNumber = rule.lineNumber; 110 var lineNumber = rule.lineNumber;
111 if (!isNaN(lineNumber) && lineNumber >= 0) 111 if (!isNaN(lineNumber) && lineNumber >= 0)
112 this._selectItemCallback(lineNumber, rule.columnNumber); 112 this._selectItemCallback(lineNumber, rule.columnNumber);
113 } 113 }
114 }; 114 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698