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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/sources/SourcesPanel.js
diff --git a/Source/devtools/front_end/sources/SourcesPanel.js b/Source/devtools/front_end/sources/SourcesPanel.js
index 4c0bc068a04649ae2e3830080bbefc636c5c682b..c36afc8da100fd145e83d78e4231adbf6933557e 100644
--- a/Source/devtools/front_end/sources/SourcesPanel.js
+++ b/Source/devtools/front_end/sources/SourcesPanel.js
@@ -667,10 +667,17 @@ WebInspector.SourcesPanel.prototype = {
},
/**
- * @param {!WebInspector.DebuggerModel.Location} rawLocation
+ * @param {!WebInspector.UILocation} uiLocation
*/
- continueToLocation: function(rawLocation)
+ _continueToLocation: function(uiLocation)
{
+ var executionContext = WebInspector.context.flavor(WebInspector.ExecutionContext);
+ if (!executionContext)
+ return;
+ var rawLocation = WebInspector.debuggerWorkspaceBinding.uiLocationToRawLocation(executionContext.target(), uiLocation.uiSourceCode, uiLocation.lineNumber, uiLocation.columnNumber);
+ if (!rawLocation)
+ return;
+
if (!this._prepareToResume())
return;
@@ -820,6 +827,7 @@ WebInspector.SourcesPanel.prototype = {
appendApplicableItems: function(event, contextMenu, target)
{
this._appendUISourceCodeItems(event, contextMenu, target);
+ this.appendUILocationItems(contextMenu, target);
this._appendRemoteObjectItems(contextMenu, target);
this._appendNetworkRequestItems(contextMenu, target);
},
@@ -925,21 +933,41 @@ WebInspector.SourcesPanel.prototype = {
var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (target);
var projectType = uiSourceCode.project().type();
+
+ if (projectType !== WebInspector.projectTypes.Debugger && !event.target.isSelfOrDescendant(this._navigator.view.element)) {
+ contextMenu.appendItem(WebInspector.UIString.capitalize("Reveal in ^navigator"), this._handleContextMenuReveal.bind(this, uiSourceCode));
+ contextMenu.appendSeparator();
+ }
+ this._appendUISourceCodeMappingItems(contextMenu, uiSourceCode);
if (projectType !== WebInspector.projectTypes.FileSystem)
contextMenu.appendItem(WebInspector.UIString.capitalize("Local ^modifications\u2026"), this._showLocalHistory.bind(this, uiSourceCode));
- this._appendUISourceCodeMappingItems(contextMenu, uiSourceCode);
+ },
+
+ /**
+ * @param {!WebInspector.ContextMenu} contextMenu
+ * @param {!Object} object
+ */
+ appendUILocationItems: function(contextMenu, object)
+ {
+ if (!(object instanceof WebInspector.UILocation))
+ return;
+ var uiLocation = /** @type {!WebInspector.UILocation} */ (object);
+ var uiSourceCode = uiLocation.uiSourceCode;
+ var projectType = uiSourceCode.project().type();
var contentType = uiSourceCode.contentType();
+ if (contentType === WebInspector.resourceTypes.Script || contentType === WebInspector.resourceTypes.Document) {
+ var target = WebInspector.context.flavor(WebInspector.Target);
+ var debuggerModel = WebInspector.DebuggerModel.fromTarget(target);
+ if (debuggerModel && debuggerModel.isPaused())
+ contextMenu.appendItem(WebInspector.UIString.capitalize("Continue to ^here"), this._continueToLocation.bind(this, uiLocation));
+ }
+
if ((contentType === WebInspector.resourceTypes.Script || contentType === WebInspector.resourceTypes.Document) && projectType !== WebInspector.projectTypes.Snippets) {
var networkURL = this._networkMapping.networkURL(uiSourceCode);
var url = projectType === WebInspector.projectTypes.Formatter ? uiSourceCode.originURL() : networkURL;
this.sidebarPanes.callstack.appendBlackboxURLContextMenuItems(contextMenu, url, projectType === WebInspector.projectTypes.ContentScripts);
}
-
- if (projectType !== WebInspector.projectTypes.Debugger && !event.target.isSelfOrDescendant(this._navigator.view.element)) {
- contextMenu.appendSeparator();
- contextMenu.appendItem(WebInspector.UIString.capitalize("Reveal in ^navigator"), this._handleContextMenuReveal.bind(this, uiSourceCode));
- }
},
/**
« 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