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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js

Issue 2238883004: DevTools: Split off SourcesTextEditor from CodeMirrorTextEditor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Stray line Created 4 years, 3 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) 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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698