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

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

Issue 2217783002: DevTools: use view locations in the elements and sources sidebars. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: for landing Created 4 years, 4 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 12 matching lines...) Expand all
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
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.View} 33 * @extends {WebInspector.SimpleView}
34 * @implements {WebInspector.Searchable} 34 * @implements {WebInspector.Searchable}
35 * @implements {WebInspector.Replaceable} 35 * @implements {WebInspector.Replaceable}
36 * @param {string} url 36 * @param {string} url
37 * @param {function(): !Promise<?string>} lazyContent 37 * @param {function(): !Promise<?string>} lazyContent
38 */ 38 */
39 WebInspector.SourceFrame = function(url, lazyContent) 39 WebInspector.SourceFrame = function(url, lazyContent)
40 { 40 {
41 WebInspector.View.call(this, WebInspector.UIString("Source")); 41 WebInspector.SimpleView.call(this, WebInspector.UIString("Source"));
42 42
43 this._url = url; 43 this._url = url;
44 this._lazyContent = lazyContent; 44 this._lazyContent = lazyContent;
45 45
46 var textEditorDelegate = new WebInspector.TextEditorDelegateForSourceFrame(t his); 46 var textEditorDelegate = new WebInspector.TextEditorDelegateForSourceFrame(t his);
47 47
48 this._textEditor = new WebInspector.CodeMirrorTextEditor(this._url, textEdit orDelegate); 48 this._textEditor = new WebInspector.CodeMirrorTextEditor(this._url, textEdit orDelegate);
49 49
50 this._currentSearchResultIndex = -1; 50 this._currentSearchResultIndex = -1;
51 this._searchResults = []; 51 this._searchResults = [];
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 { 99 {
100 WebInspector.Widget.prototype.willHide.call(this); 100 WebInspector.Widget.prototype.willHide.call(this);
101 101
102 this._clearPositionToReveal(); 102 this._clearPositionToReveal();
103 }, 103 },
104 104
105 /** 105 /**
106 * @override 106 * @override
107 * @return {!Array<!WebInspector.ToolbarItem>} 107 * @return {!Array<!WebInspector.ToolbarItem>}
108 */ 108 */
109 toolbarItems: function() 109 syncToolbarItems: function()
110 { 110 {
111 return [this._sourcePosition]; 111 return [this._sourcePosition];
112 }, 112 },
113 113
114 get loaded() 114 get loaded()
115 { 115 {
116 return this._loaded; 116 return this._loaded;
117 }, 117 },
118 118
119 get textEditor() 119 get textEditor()
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 }, 631 },
632 632
633 _handleKeyDown: function(e) 633 _handleKeyDown: function(e)
634 { 634 {
635 var shortcutKey = WebInspector.KeyboardShortcut.makeKeyFromEvent(e); 635 var shortcutKey = WebInspector.KeyboardShortcut.makeKeyFromEvent(e);
636 var handler = this._shortcuts[shortcutKey]; 636 var handler = this._shortcuts[shortcutKey];
637 if (handler && handler()) 637 if (handler && handler())
638 e.consume(true); 638 e.consume(true);
639 }, 639 },
640 640
641 __proto__: WebInspector.View.prototype 641 __proto__: WebInspector.SimpleView.prototype
642 } 642 }
643 643
644 /** 644 /**
645 * @implements {WebInspector.TextEditorDelegate} 645 * @implements {WebInspector.TextEditorDelegate}
646 * @constructor 646 * @constructor
647 */ 647 */
648 WebInspector.TextEditorDelegateForSourceFrame = function(sourceFrame) 648 WebInspector.TextEditorDelegateForSourceFrame = function(sourceFrame)
649 { 649 {
650 this._sourceFrame = sourceFrame; 650 this._sourceFrame = sourceFrame;
651 } 651 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 /** 713 /**
714 * @override 714 * @override
715 * @param {?WebInspector.TextRange} from 715 * @param {?WebInspector.TextRange} from
716 * @param {?WebInspector.TextRange} to 716 * @param {?WebInspector.TextRange} to
717 */ 717 */
718 onJumpToPosition: function(from, to) 718 onJumpToPosition: function(from, to)
719 { 719 {
720 this._sourceFrame.onJumpToPosition(from, to); 720 this._sourceFrame.onJumpToPosition(from, to);
721 } 721 }
722 } 722 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698