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

Unified Diff: Source/devtools/front_end/sources/SourcesPanel.js

Issue 311193002: DevTools: Implement debugger pause-resume through an action (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comment Created 6 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 7c3e0d6195c0667a5e5df24ee7913f140e0b08a7..c6ef72a7275c6eabca64706bf448b90daad3f8d3 100644
--- a/Source/devtools/front_end/sources/SourcesPanel.js
+++ b/Source/devtools/front_end/sources/SourcesPanel.js
@@ -198,6 +198,7 @@ WebInspector.SourcesPanel.prototype = {
wasShown: function()
{
+ WebInspector.context.setFlavor(WebInspector.SourcesPanel, this);
if (WebInspector.experimentsSettings.editorInDrawer.isEnabled()) {
this._drawerEditor()._panelWasShown();
this._sourcesView.show(this.editorView.mainElement());
@@ -212,6 +213,7 @@ WebInspector.SourcesPanel.prototype = {
this._drawerEditor()._panelWillHide();
this._sourcesView.show(this._drawerEditorView.element);
}
+ WebInspector.context.setFlavor(WebInspector.SourcesPanel, null);
},
/**
@@ -671,8 +673,8 @@ WebInspector.SourcesPanel.prototype = {
this._runSnippetButton.element.classList.add("hidden");
// Continue.
- handler = this.togglePause.bind(this);
- this._pauseButton = this._createButtonAndRegisterShortcuts("scripts-pause", "", handler, WebInspector.ShortcutsScreen.SourcesPanelShortcuts.PauseContinue);
+ handler = function() { return WebInspector.actionRegistry.execute("debugger.toggle-pause"); };
+ this._pauseButton = this._createButtonAndRegisterShortcuts("scripts-pause", "", handler, []);
debugToolbar.appendChild(this._pauseButton.element);
// Long resume.
@@ -1395,3 +1397,22 @@ WebInspector.SourcesPanel.DisableJavaScriptSettingDelegate.prototype = {
__proto__: WebInspector.UISettingDelegate.prototype
}
+
+/**
+ * @constructor
+ * @implements {WebInspector.ActionDelegate}
+ */
+WebInspector.SourcesPanel.TogglePauseActionDelegate = function()
+{
+}
+
+WebInspector.SourcesPanel.TogglePauseActionDelegate.prototype = {
+ /**
+ * @return {boolean}
+ */
+ handleAction: function()
+ {
+ /** @type {!WebInspector.SourcesPanel} */ (WebInspector.inspectorView.showPanel("sources")).togglePause();
+ return true;
+ }
+}
« no previous file with comments | « Source/devtools/front_end/ForwardedInputEventHandler.js ('k') | Source/devtools/front_end/sources/module.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698