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 @@
},
{
"type": "action",
"category": "Debugger",
"actionId": "debugger.step-over",
"className": "Sources.SourcesPanel.DebuggingActionDelegate",
"title": "Step over next function call",
"iconClass": "largeicon-step-over",
"contextTypes": [
"Sources.SourcesPanel"
"SDK.DebuggerPausedDetails"
],
"bindings": [
{
......@@ -73,12 +74,13 @@
},
{
"type": "action",
"category": "Debugger",
"actionId": "debugger.step-into",
"className": "Sources.SourcesPanel.DebuggingActionDelegate",
"title": "Step into next function call",
"iconClass": "largeicon-step-into",
"contextTypes": [
"Sources.SourcesPanel"
"SDK.DebuggerPausedDetails"
],
"bindings": [
{
......@@ -93,12 +95,13 @@
},
{
"type": "action",
"category": "Debugger",
"actionId": "debugger.step",
"className": "Sources.SourcesPanel.DebuggingActionDelegate",
"title": "Step",
"iconClass": "largeicon-step",
"contextTypes": [
"Sources.SourcesPanel"
"SDK.DebuggerPausedDetails"
],
"bindings": [
{
......@@ -108,12 +111,13 @@
},
{
"type": "action",
"category": "Debugger",
"actionId": "debugger.step-out",
"className": "Sources.SourcesPanel.DebuggingActionDelegate",
"title": "Step out of current function",
"iconClass": "largeicon-step-out",
"contextTypes": [
"Sources.SourcesPanel"
"SDK.DebuggerPausedDetails"
],
"bindings": [
{
......@@ -816,8 +820,9 @@
"category": "Debugger",
"actionId": "debugger.previous-call-frame",
"className": "Sources.CallStackSidebarPane.ActionDelegate",
"title": "Previous call frame",
"contextTypes": [
"Sources.SourcesPanel"
"SDK.DebuggerPausedDetails"
],
"bindings": [
{
......@@ -830,8 +835,9 @@
"category": "Debugger",
"actionId": "debugger.next-call-frame",
"className": "Sources.CallStackSidebarPane.ActionDelegate",
"title": "Next call frame",
"contextTypes": [
"Sources.SourcesPanel"
"SDK.DebuggerPausedDetails"
],
"bindings": [
{
......
......@@ -24,7 +24,12 @@ UI.ActionRegistry = class {
var actionId = extension.descriptor()['actionId'];
console.assert(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