Commit e663d595 authored by Erik Luo's avatar Erik Luo Committed by Commit Bot

DevTools: fix Sources extensions with Command Menu entries

- Adds a check for valid CommandMenu extensions (category actions
  must have a title, otherwise CommandMenu fails to populate)
- Fixes 'debugger.previous/next-call-frame's title
- Adds 'Step*' actions to CommandMenu

Bug: 812715
Change-Id: I9396f797d474556c593b678c372f9423bf2d04b1
Reviewed-on: https://chromium-review.googlesource.com/922505
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Reviewed-by: default avatarJoel Einbinder <einbinder@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537134}
parent 96f8e9ce
...@@ -53,12 +53,13 @@ ...@@ -53,12 +53,13 @@
}, },
{ {
"type": "action", "type": "action",
"category": "Debugger",
"actionId": "debugger.step-over", "actionId": "debugger.step-over",
"className": "Sources.SourcesPanel.DebuggingActionDelegate", "className": "Sources.SourcesPanel.DebuggingActionDelegate",
"title": "Step over next function call", "title": "Step over next function call",
"iconClass": "largeicon-step-over", "iconClass": "largeicon-step-over",
"contextTypes": [ "contextTypes": [
"Sources.SourcesPanel" "SDK.DebuggerPausedDetails"
], ],
"bindings": [ "bindings": [
{ {
...@@ -73,12 +74,13 @@ ...@@ -73,12 +74,13 @@
}, },
{ {
"type": "action", "type": "action",
"category": "Debugger",
"actionId": "debugger.step-into", "actionId": "debugger.step-into",
"className": "Sources.SourcesPanel.DebuggingActionDelegate", "className": "Sources.SourcesPanel.DebuggingActionDelegate",
"title": "Step into next function call", "title": "Step into next function call",
"iconClass": "largeicon-step-into", "iconClass": "largeicon-step-into",
"contextTypes": [ "contextTypes": [
"Sources.SourcesPanel" "SDK.DebuggerPausedDetails"
], ],
"bindings": [ "bindings": [
{ {
...@@ -93,12 +95,13 @@ ...@@ -93,12 +95,13 @@
}, },
{ {
"type": "action", "type": "action",
"category": "Debugger",
"actionId": "debugger.step", "actionId": "debugger.step",
"className": "Sources.SourcesPanel.DebuggingActionDelegate", "className": "Sources.SourcesPanel.DebuggingActionDelegate",
"title": "Step", "title": "Step",
"iconClass": "largeicon-step", "iconClass": "largeicon-step",
"contextTypes": [ "contextTypes": [
"Sources.SourcesPanel" "SDK.DebuggerPausedDetails"
], ],
"bindings": [ "bindings": [
{ {
...@@ -108,12 +111,13 @@ ...@@ -108,12 +111,13 @@
}, },
{ {
"type": "action", "type": "action",
"category": "Debugger",
"actionId": "debugger.step-out", "actionId": "debugger.step-out",
"className": "Sources.SourcesPanel.DebuggingActionDelegate", "className": "Sources.SourcesPanel.DebuggingActionDelegate",
"title": "Step out of current function", "title": "Step out of current function",
"iconClass": "largeicon-step-out", "iconClass": "largeicon-step-out",
"contextTypes": [ "contextTypes": [
"Sources.SourcesPanel" "SDK.DebuggerPausedDetails"
], ],
"bindings": [ "bindings": [
{ {
...@@ -816,8 +820,9 @@ ...@@ -816,8 +820,9 @@
"category": "Debugger", "category": "Debugger",
"actionId": "debugger.previous-call-frame", "actionId": "debugger.previous-call-frame",
"className": "Sources.CallStackSidebarPane.ActionDelegate", "className": "Sources.CallStackSidebarPane.ActionDelegate",
"title": "Previous call frame",
"contextTypes": [ "contextTypes": [
"Sources.SourcesPanel" "SDK.DebuggerPausedDetails"
], ],
"bindings": [ "bindings": [
{ {
...@@ -830,8 +835,9 @@ ...@@ -830,8 +835,9 @@
"category": "Debugger", "category": "Debugger",
"actionId": "debugger.next-call-frame", "actionId": "debugger.next-call-frame",
"className": "Sources.CallStackSidebarPane.ActionDelegate", "className": "Sources.CallStackSidebarPane.ActionDelegate",
"title": "Next call frame",
"contextTypes": [ "contextTypes": [
"Sources.SourcesPanel" "SDK.DebuggerPausedDetails"
], ],
"bindings": [ "bindings": [
{ {
......
...@@ -24,7 +24,12 @@ UI.ActionRegistry = class { ...@@ -24,7 +24,12 @@ UI.ActionRegistry = class {
var actionId = extension.descriptor()['actionId']; var actionId = extension.descriptor()['actionId'];
console.assert(actionId); console.assert(actionId);
console.assert(!this._actionsById.get(actionId)); console.assert(!this._actionsById.get(actionId));
this._actionsById.set(actionId, new UI.Action(extension));
var action = new UI.Action(extension);
if (!action.category() || action.title())
this._actionsById.set(actionId, action);
else
console.error(`Category actions require a title for command menu: ${actionId}`);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment