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

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

Issue 2157713002: DevTools: introduce View: a named widget with the toolbar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaselined Created 4 years, 5 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.VBoxWithToolbarItems} 33 * @extends {WebInspector.View}
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.VBoxWithToolbarItems.call(this); 41 WebInspector.View.call(this, WebInspector.UIString("Source"));
dgozman 2016/07/20 01:37:16 SourceFrame is a view? Sounds bad. Same goes for I
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 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 }, 638 },
639 639
640 _handleKeyDown: function(e) 640 _handleKeyDown: function(e)
641 { 641 {
642 var shortcutKey = WebInspector.KeyboardShortcut.makeKeyFromEvent(e); 642 var shortcutKey = WebInspector.KeyboardShortcut.makeKeyFromEvent(e);
643 var handler = this._shortcuts[shortcutKey]; 643 var handler = this._shortcuts[shortcutKey];
644 if (handler && handler()) 644 if (handler && handler())
645 e.consume(true); 645 e.consume(true);
646 }, 646 },
647 647
648 __proto__: WebInspector.VBoxWithToolbarItems.prototype 648 __proto__: WebInspector.View.prototype
649 } 649 }
650 650
651 /** 651 /**
652 * @implements {WebInspector.TextEditorDelegate} 652 * @implements {WebInspector.TextEditorDelegate}
653 * @constructor 653 * @constructor
654 */ 654 */
655 WebInspector.TextEditorDelegateForSourceFrame = function(sourceFrame) 655 WebInspector.TextEditorDelegateForSourceFrame = function(sourceFrame)
656 { 656 {
657 this._sourceFrame = sourceFrame; 657 this._sourceFrame = sourceFrame;
658 } 658 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 /** 720 /**
721 * @override 721 * @override
722 * @param {?WebInspector.TextRange} from 722 * @param {?WebInspector.TextRange} from
723 * @param {?WebInspector.TextRange} to 723 * @param {?WebInspector.TextRange} to
724 */ 724 */
725 onJumpToPosition: function(from, to) 725 onJumpToPosition: function(from, to)
726 { 726 {
727 this._sourceFrame.onJumpToPosition(from, to); 727 this._sourceFrame.onJumpToPosition(from, to);
728 } 728 }
729 } 729 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698