| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 */ | 28 */ |
| 29 /** | 29 /** |
| 30 * @implements {UI.Searchable} | 30 * @implements {UI.Searchable} |
| 31 * @implements {SDK.TargetManager.Observer} | 31 * @implements {SDK.TargetManager.Observer} |
| 32 * @implements {UI.ViewportControl.Provider} | 32 * @implements {Console.ConsoleViewportProvider} |
| 33 * @unrestricted | 33 * @unrestricted |
| 34 */ | 34 */ |
| 35 Console.ConsoleView = class extends UI.VBox { | 35 Console.ConsoleView = class extends UI.VBox { |
| 36 constructor() { | 36 constructor() { |
| 37 super(); | 37 super(); |
| 38 this.setMinimumSize(0, 35); | 38 this.setMinimumSize(0, 35); |
| 39 this.registerRequiredCSS('console/consoleView.css'); | 39 this.registerRequiredCSS('console/consoleView.css'); |
| 40 | 40 |
| 41 this._searchableView = new UI.SearchableView(this); | 41 this._searchableView = new UI.SearchableView(this); |
| 42 this._searchableView.setPlaceholder(Common.UIString('Find string in logs')); | 42 this._searchableView.setPlaceholder(Common.UIString('Find string in logs')); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 73 toolbar.appendToolbarItem(UI.Toolbar.createActionButton( | 73 toolbar.appendToolbarItem(UI.Toolbar.createActionButton( |
| 74 /** @type {!UI.Action }*/ (UI.actionRegistry.action('console.clear')))); | 74 /** @type {!UI.Action }*/ (UI.actionRegistry.action('console.clear')))); |
| 75 toolbar.appendToolbarItem(this._filterBar.filterButton()); | 75 toolbar.appendToolbarItem(this._filterBar.filterButton()); |
| 76 toolbar.appendToolbarItem(this._executionContextComboBox); | 76 toolbar.appendToolbarItem(this._executionContextComboBox); |
| 77 toolbar.appendToolbarItem(this._preserveLogCheckbox); | 77 toolbar.appendToolbarItem(this._preserveLogCheckbox); |
| 78 toolbar.appendToolbarItem(this._progressToolbarItem); | 78 toolbar.appendToolbarItem(this._progressToolbarItem); |
| 79 | 79 |
| 80 this._filterBar.show(this._contentsElement); | 80 this._filterBar.show(this._contentsElement); |
| 81 this._filter.addFilters(this._filterBar); | 81 this._filter.addFilters(this._filterBar); |
| 82 | 82 |
| 83 this._viewport = new UI.ViewportControl(this); | 83 this._viewport = new Console.ConsoleViewport(this); |
| 84 this._viewport.setStickToBottom(true); | 84 this._viewport.setStickToBottom(true); |
| 85 this._viewport.contentElement().classList.add('console-group', 'console-grou
p-messages'); | 85 this._viewport.contentElement().classList.add('console-group', 'console-grou
p-messages'); |
| 86 this._contentsElement.appendChild(this._viewport.element); | 86 this._contentsElement.appendChild(this._viewport.element); |
| 87 this._messagesElement = this._viewport.element; | 87 this._messagesElement = this._viewport.element; |
| 88 this._messagesElement.id = 'console-messages'; | 88 this._messagesElement.id = 'console-messages'; |
| 89 this._messagesElement.classList.add('monospace'); | 89 this._messagesElement.classList.add('monospace'); |
| 90 this._messagesElement.addEventListener('click', this._messagesClicked.bind(t
his), true); | 90 this._messagesElement.addEventListener('click', this._messagesClicked.bind(t
his), true); |
| 91 | 91 |
| 92 this._viewportThrottler = new Common.Throttler(50); | 92 this._viewportThrottler = new Common.Throttler(50); |
| 93 | 93 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 * @override | 234 * @override |
| 235 * @return {number} | 235 * @return {number} |
| 236 */ | 236 */ |
| 237 itemCount() { | 237 itemCount() { |
| 238 return this._visibleViewMessages.length; | 238 return this._visibleViewMessages.length; |
| 239 } | 239 } |
| 240 | 240 |
| 241 /** | 241 /** |
| 242 * @override | 242 * @override |
| 243 * @param {number} index | 243 * @param {number} index |
| 244 * @return {?UI.ViewportElement} | 244 * @return {?Console.ConsoleViewportElement} |
| 245 */ | 245 */ |
| 246 itemElement(index) { | 246 itemElement(index) { |
| 247 return this._visibleViewMessages[index]; | 247 return this._visibleViewMessages[index]; |
| 248 } | 248 } |
| 249 | 249 |
| 250 /** | 250 /** |
| 251 * @override | 251 * @override |
| 252 * @param {number} index | 252 * @param {number} index |
| 253 * @return {number} | 253 * @return {number} |
| 254 */ | 254 */ |
| (...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1336 return true; | 1336 return true; |
| 1337 } | 1337 } |
| 1338 return false; | 1338 return false; |
| 1339 } | 1339 } |
| 1340 }; | 1340 }; |
| 1341 | 1341 |
| 1342 /** | 1342 /** |
| 1343 * @typedef {{messageIndex: number, matchIndex: number}} | 1343 * @typedef {{messageIndex: number, matchIndex: number}} |
| 1344 */ | 1344 */ |
| 1345 Console.ConsoleView.RegexMatchRange; | 1345 Console.ConsoleView.RegexMatchRange; |
| OLD | NEW |