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

Side by Side Diff: Source/devtools/front_end/SourceFrame.js

Issue 23474010: DevTools: "Jump between editing locations" experiment (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: addressed @vsevik comments Created 6 years, 11 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 | Annotate | Revision Log
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 // Otherwise just do case-insensitive search. 86 // Otherwise just do case-insensitive search.
87 if (!regex) 87 if (!regex)
88 regex = createPlainTextSearchRegex(query, "i" + modifiers); 88 regex = createPlainTextSearchRegex(query, "i" + modifiers);
89 89
90 return regex; 90 return regex;
91 } 91 }
92 92
93 WebInspector.SourceFrame.Events = { 93 WebInspector.SourceFrame.Events = {
94 ScrollChanged: "ScrollChanged", 94 ScrollChanged: "ScrollChanged",
95 SelectionChanged: "SelectionChanged" 95 SelectionChanged: "SelectionChanged",
96 JumpHappened: "JumpHappened"
96 } 97 }
97 98
98 WebInspector.SourceFrame.prototype = { 99 WebInspector.SourceFrame.prototype = {
99 /** 100 /**
100 * @param {number} key 101 * @param {number} key
101 * @param {function()} handler 102 * @param {function()} handler
102 */ 103 */
103 addShortcut: function(key, handler) 104 addShortcut: function(key, handler)
104 { 105 {
105 this._shortcuts[key] = handler; 106 this._shortcuts[key] = handler;
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 }, 727 },
727 728
728 populateLineGutterContextMenu: function(contextMenu, lineNumber) 729 populateLineGutterContextMenu: function(contextMenu, lineNumber)
729 { 730 {
730 }, 731 },
731 732
732 populateTextAreaContextMenu: function(contextMenu, lineNumber) 733 populateTextAreaContextMenu: function(contextMenu, lineNumber)
733 { 734 {
734 }, 735 },
735 736
737 /**
738 * @param {?WebInspector.TextRange} from
739 * @param {?WebInspector.TextRange} to
740 */
741 onJumpToPosition: function(from, to)
742 {
743 this.dispatchEventToListeners(WebInspector.SourceFrame.Events.JumpHappen ed, {
744 from: from,
745 to: to
746 });
747 },
748
736 inheritScrollPositions: function(sourceFrame) 749 inheritScrollPositions: function(sourceFrame)
737 { 750 {
738 this._textEditor.inheritScrollPositions(sourceFrame._textEditor); 751 this._textEditor.inheritScrollPositions(sourceFrame._textEditor);
739 }, 752 },
740 753
741 /** 754 /**
742 * @return {boolean} 755 * @return {boolean}
743 */ 756 */
744 canEditSource: function() 757 canEditSource: function()
745 { 758 {
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 875
863 /** 876 /**
864 * @param {string} hrefValue 877 * @param {string} hrefValue
865 * @param {boolean} isExternal 878 * @param {boolean} isExternal
866 * @return {!Element} 879 * @return {!Element}
867 */ 880 */
868 createLink: function(hrefValue, isExternal) 881 createLink: function(hrefValue, isExternal)
869 { 882 {
870 var targetLocation = WebInspector.ParsedURL.completeURL(this._sourceFram e._url, hrefValue); 883 var targetLocation = WebInspector.ParsedURL.completeURL(this._sourceFram e._url, hrefValue);
871 return WebInspector.linkifyURLAsNode(targetLocation || hrefValue, hrefVa lue, undefined, isExternal); 884 return WebInspector.linkifyURLAsNode(targetLocation || hrefValue, hrefVa lue, undefined, isExternal);
885 },
886
887 /**
888 * @param {?WebInspector.TextRange} from
889 * @param {?WebInspector.TextRange} to
890 */
891 onJumpToPosition: function(from, to)
892 {
893 this._sourceFrame.onJumpToPosition(from, to);
872 } 894 }
873 } 895 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698