| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.Widget} | 7 * @extends {WebInspector.Widget} |
| 8 */ | 8 */ |
| 9 WebInspector.ClassesPaneWidget = function() | 9 WebInspector.ClassesPaneWidget = function() |
| 10 { | 10 { |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 return this._button; | 217 return this._button; |
| 218 } | 218 } |
| 219 }; | 219 }; |
| 220 | 220 |
| 221 /** | 221 /** |
| 222 * @constructor | 222 * @constructor |
| 223 * @extends {WebInspector.TextPrompt} | 223 * @extends {WebInspector.TextPrompt} |
| 224 */ | 224 */ |
| 225 WebInspector.ClassesPaneWidget.ClassNamePrompt = function() | 225 WebInspector.ClassesPaneWidget.ClassNamePrompt = function() |
| 226 { | 226 { |
| 227 WebInspector.TextPrompt.call(this, this._buildClassNameCompletions.bind(this
), " "); | 227 WebInspector.TextPrompt.call(this); |
| 228 this.initialize(this._buildClassNameCompletions.bind(this), " "); |
| 228 this.setSuggestBoxEnabled(true); | 229 this.setSuggestBoxEnabled(true); |
| 229 this.disableDefaultSuggestionForEmptyInput(); | 230 this.disableDefaultSuggestionForEmptyInput(); |
| 230 this._selectedFrameId = ""; | 231 this._selectedFrameId = ""; |
| 231 this._classNamesPromise = null; | 232 this._classNamesPromise = null; |
| 232 }; | 233 }; |
| 233 | 234 |
| 234 WebInspector.ClassesPaneWidget.ClassNamePrompt.prototype = { | 235 WebInspector.ClassesPaneWidget.ClassNamePrompt.prototype = { |
| 235 /** | 236 /** |
| 236 * @param {!WebInspector.DOMNode} selectedNode | 237 * @param {!WebInspector.DOMNode} selectedNode |
| 237 * @return {!Promise.<!Array.<string>>} | 238 * @return {!Promise.<!Array.<string>>} |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 this._classNamesPromise.then(completions => { | 281 this._classNamesPromise.then(completions => { |
| 281 if (prefix[0] === ".") | 282 if (prefix[0] === ".") |
| 282 completions = completions.map(value => "." + value); | 283 completions = completions.map(value => "." + value); |
| 283 var results = completions.filter(value => value.startsWith(prefix)); | 284 var results = completions.filter(value => value.startsWith(prefix)); |
| 284 completionsReadyCallback(results, 0); | 285 completionsReadyCallback(results, 0); |
| 285 }); | 286 }); |
| 286 }, | 287 }, |
| 287 | 288 |
| 288 __proto__: WebInspector.TextPrompt.prototype | 289 __proto__: WebInspector.TextPrompt.prototype |
| 289 }; | 290 }; |
| OLD | NEW |