| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 /** | 31 /** |
| 32 * @constructor | 32 * @constructor |
| 33 * @extends {WebInspector.SimpleView} | 33 * @extends {WebInspector.SimpleView} |
| 34 * @implements {WebInspector.Searchable} | 34 * @implements {WebInspector.Searchable} |
| 35 * @implements {WebInspector.Replaceable} | 35 * @implements {WebInspector.Replaceable} |
| 36 * @implements {WebInspector.TextEditorDelegate} | 36 * @implements {WebInspector.SourcesTextEditorDelegate} |
| 37 * @param {string} url | 37 * @param {string} url |
| 38 * @param {function(): !Promise<?string>} lazyContent | 38 * @param {function(): !Promise<?string>} lazyContent |
| 39 */ | 39 */ |
| 40 WebInspector.SourceFrame = function(url, lazyContent) | 40 WebInspector.SourceFrame = function(url, lazyContent) |
| 41 { | 41 { |
| 42 WebInspector.SimpleView.call(this, WebInspector.UIString("Source")); | 42 WebInspector.SimpleView.call(this, WebInspector.UIString("Source")); |
| 43 | 43 |
| 44 this._url = url; | 44 this._url = url; |
| 45 this._lazyContent = lazyContent; | 45 this._lazyContent = lazyContent; |
| 46 | 46 |
| 47 this._textEditor = new WebInspector.CodeMirrorTextEditor(this); | 47 this._textEditor = new WebInspector.SourcesTextEditor(this); |
| 48 | 48 |
| 49 this._currentSearchResultIndex = -1; | 49 this._currentSearchResultIndex = -1; |
| 50 this._searchResults = []; | 50 this._searchResults = []; |
| 51 | 51 |
| 52 this._textEditor.setReadOnly(!this.canEditSource()); | 52 this._textEditor.setReadOnly(!this.canEditSource()); |
| 53 | 53 |
| 54 this._shortcuts = {}; | 54 this._shortcuts = {}; |
| 55 this.element.addEventListener("keydown", this._handleKeyDown.bind(this), fal
se); | 55 this.element.addEventListener("keydown", this._handleKeyDown.bind(this), fal
se); |
| 56 | 56 |
| 57 this._sourcePosition = new WebInspector.ToolbarText(); | 57 this._sourcePosition = new WebInspector.ToolbarText(); |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 _handleKeyDown: function(e) | 644 _handleKeyDown: function(e) |
| 645 { | 645 { |
| 646 var shortcutKey = WebInspector.KeyboardShortcut.makeKeyFromEvent(e); | 646 var shortcutKey = WebInspector.KeyboardShortcut.makeKeyFromEvent(e); |
| 647 var handler = this._shortcuts[shortcutKey]; | 647 var handler = this._shortcuts[shortcutKey]; |
| 648 if (handler && handler()) | 648 if (handler && handler()) |
| 649 e.consume(true); | 649 e.consume(true); |
| 650 }, | 650 }, |
| 651 | 651 |
| 652 __proto__: WebInspector.SimpleView.prototype | 652 __proto__: WebInspector.SimpleView.prototype |
| 653 } | 653 } |
| OLD | NEW |