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

Side by Side Diff: Source/devtools/front_end/sources/SourcesPanel.js

Issue 1165263002: DevTools: Add 'continue to here' to the editor context menu. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 callFrame.debuggerModel.setSelectedCallFrame(callFrame); 660 callFrame.debuggerModel.setSelectedCallFrame(callFrame);
661 }, 661 },
662 662
663 _hiddenCallFramesRevealedInSidebar: function() 663 _hiddenCallFramesRevealedInSidebar: function()
664 { 664 {
665 if (Runtime.experiments.isEnabled("stepIntoAsync")) 665 if (Runtime.experiments.isEnabled("stepIntoAsync"))
666 this.sidebarPanes.asyncOperationBreakpoints.revealHiddenCallFrames(W ebInspector.context.flavor(WebInspector.Target)); 666 this.sidebarPanes.asyncOperationBreakpoints.revealHiddenCallFrames(W ebInspector.context.flavor(WebInspector.Target));
667 }, 667 },
668 668
669 /** 669 /**
670 * @param {!WebInspector.DebuggerModel.Location} rawLocation 670 * @param {!WebInspector.UILocation} uiLocation
671 */ 671 */
672 continueToLocation: function(rawLocation) 672 _continueToLocation: function(uiLocation)
673 { 673 {
674 var executionContext = WebInspector.context.flavor(WebInspector.Executio nContext);
675 if (!executionContext)
676 return;
677 var rawLocation = WebInspector.debuggerWorkspaceBinding.uiLocationToRawL ocation(executionContext.target(), uiLocation.uiSourceCode, uiLocation.lineNumbe r, uiLocation.columnNumber);
678 if (!rawLocation)
679 return;
680
674 if (!this._prepareToResume()) 681 if (!this._prepareToResume())
675 return; 682 return;
676 683
677 rawLocation.continueToLocation(); 684 rawLocation.continueToLocation();
678 }, 685 },
679 686
680 _toggleBreakpointsClicked: function(event) 687 _toggleBreakpointsClicked: function(event)
681 { 688 {
682 WebInspector.breakpointManager.setBreakpointsActive(!WebInspector.breakp ointManager.breakpointsActive()); 689 WebInspector.breakpointManager.setBreakpointsActive(!WebInspector.breakp ointManager.breakpointsActive());
683 }, 690 },
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 820
814 /** 821 /**
815 * @override 822 * @override
816 * @param {!Event} event 823 * @param {!Event} event
817 * @param {!WebInspector.ContextMenu} contextMenu 824 * @param {!WebInspector.ContextMenu} contextMenu
818 * @param {!Object} target 825 * @param {!Object} target
819 */ 826 */
820 appendApplicableItems: function(event, contextMenu, target) 827 appendApplicableItems: function(event, contextMenu, target)
821 { 828 {
822 this._appendUISourceCodeItems(event, contextMenu, target); 829 this._appendUISourceCodeItems(event, contextMenu, target);
830 this.appendUILocationItems(contextMenu, target);
823 this._appendRemoteObjectItems(contextMenu, target); 831 this._appendRemoteObjectItems(contextMenu, target);
824 this._appendNetworkRequestItems(contextMenu, target); 832 this._appendNetworkRequestItems(contextMenu, target);
825 }, 833 },
826 834
827 _suggestReload: function() 835 _suggestReload: function()
828 { 836 {
829 if (window.confirm(WebInspector.UIString("It is recommended to restart i nspector after making these changes. Would you like to restart it?"))) 837 if (window.confirm(WebInspector.UIString("It is recommended to restart i nspector after making these changes. Would you like to restart it?")))
830 WebInspector.reload(); 838 WebInspector.reload();
831 }, 839 },
832 840
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 * @param {!WebInspector.ContextMenu} contextMenu 926 * @param {!WebInspector.ContextMenu} contextMenu
919 * @param {!Object} target 927 * @param {!Object} target
920 */ 928 */
921 _appendUISourceCodeItems: function(event, contextMenu, target) 929 _appendUISourceCodeItems: function(event, contextMenu, target)
922 { 930 {
923 if (!(target instanceof WebInspector.UISourceCode)) 931 if (!(target instanceof WebInspector.UISourceCode))
924 return; 932 return;
925 933
926 var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (target); 934 var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (target);
927 var projectType = uiSourceCode.project().type(); 935 var projectType = uiSourceCode.project().type();
936
937 if (projectType !== WebInspector.projectTypes.Debugger && !event.target. isSelfOrDescendant(this._navigator.view.element)) {
938 contextMenu.appendItem(WebInspector.UIString.capitalize("Reveal in ^ navigator"), this._handleContextMenuReveal.bind(this, uiSourceCode));
939 contextMenu.appendSeparator();
940 }
941 this._appendUISourceCodeMappingItems(contextMenu, uiSourceCode);
928 if (projectType !== WebInspector.projectTypes.FileSystem) 942 if (projectType !== WebInspector.projectTypes.FileSystem)
929 contextMenu.appendItem(WebInspector.UIString.capitalize("Local ^modi fications\u2026"), this._showLocalHistory.bind(this, uiSourceCode)); 943 contextMenu.appendItem(WebInspector.UIString.capitalize("Local ^modi fications\u2026"), this._showLocalHistory.bind(this, uiSourceCode));
930 this._appendUISourceCodeMappingItems(contextMenu, uiSourceCode); 944 },
945
946 /**
947 * @param {!WebInspector.ContextMenu} contextMenu
948 * @param {!Object} object
949 */
950 appendUILocationItems: function(contextMenu, object)
951 {
952 if (!(object instanceof WebInspector.UILocation))
953 return;
954 var uiLocation = /** @type {!WebInspector.UILocation} */ (object);
955 var uiSourceCode = uiLocation.uiSourceCode;
956 var projectType = uiSourceCode.project().type();
931 957
932 var contentType = uiSourceCode.contentType(); 958 var contentType = uiSourceCode.contentType();
959 if (contentType === WebInspector.resourceTypes.Script || contentType === WebInspector.resourceTypes.Document) {
960 var target = WebInspector.context.flavor(WebInspector.Target);
961 var debuggerModel = WebInspector.DebuggerModel.fromTarget(target);
962 if (debuggerModel && debuggerModel.isPaused())
963 contextMenu.appendItem(WebInspector.UIString.capitalize("Continu e to ^here"), this._continueToLocation.bind(this, uiLocation));
964 }
965
933 if ((contentType === WebInspector.resourceTypes.Script || contentType == = WebInspector.resourceTypes.Document) && projectType !== WebInspector.projectTy pes.Snippets) { 966 if ((contentType === WebInspector.resourceTypes.Script || contentType == = WebInspector.resourceTypes.Document) && projectType !== WebInspector.projectTy pes.Snippets) {
934 var networkURL = this._networkMapping.networkURL(uiSourceCode); 967 var networkURL = this._networkMapping.networkURL(uiSourceCode);
935 var url = projectType === WebInspector.projectTypes.Formatter ? uiSo urceCode.originURL() : networkURL; 968 var url = projectType === WebInspector.projectTypes.Formatter ? uiSo urceCode.originURL() : networkURL;
936 this.sidebarPanes.callstack.appendBlackboxURLContextMenuItems(contex tMenu, url, projectType === WebInspector.projectTypes.ContentScripts); 969 this.sidebarPanes.callstack.appendBlackboxURLContextMenuItems(contex tMenu, url, projectType === WebInspector.projectTypes.ContentScripts);
937 } 970 }
938
939 if (projectType !== WebInspector.projectTypes.Debugger && !event.target. isSelfOrDescendant(this._navigator.view.element)) {
940 contextMenu.appendSeparator();
941 contextMenu.appendItem(WebInspector.UIString.capitalize("Reveal in ^ navigator"), this._handleContextMenuReveal.bind(this, uiSourceCode));
942 }
943 }, 971 },
944 972
945 /** 973 /**
946 * @param {!WebInspector.UISourceCode} uiSourceCode 974 * @param {!WebInspector.UISourceCode} uiSourceCode
947 */ 975 */
948 _handleContextMenuReveal: function(uiSourceCode) 976 _handleContextMenuReveal: function(uiSourceCode)
949 { 977 {
950 this.editorView.showBoth(); 978 this.editorView.showBoth();
951 this._revealInNavigator(uiSourceCode); 979 this._revealInNavigator(uiSourceCode);
952 }, 980 },
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
1421 WebInspector.SourcesPanelFactory.prototype = { 1449 WebInspector.SourcesPanelFactory.prototype = {
1422 /** 1450 /**
1423 * @override 1451 * @override
1424 * @return {!WebInspector.Panel} 1452 * @return {!WebInspector.Panel}
1425 */ 1453 */
1426 createPanel: function() 1454 createPanel: function()
1427 { 1455 {
1428 return WebInspector.SourcesPanel.instance(); 1456 return WebInspector.SourcesPanel.instance();
1429 } 1457 }
1430 } 1458 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/sources/JavaScriptSourceFrame.js ('k') | Source/devtools/front_end/sources/UISourceCodeFrame.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698