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

Unified Diff: Source/devtools/front_end/sdk/DebuggerModel.js

Issue 982783002: Revert of DevTools: Remove pageAgent() call from DebuggerModel (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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
« no previous file with comments | « Source/devtools/front_end/main/module.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/sdk/DebuggerModel.js
diff --git a/Source/devtools/front_end/sdk/DebuggerModel.js b/Source/devtools/front_end/sdk/DebuggerModel.js
index c1b143176c1058dc4d56485536bc1660c81057aa..1ce6ec555175e1af4f954dca99981a91d9d5c979 100644
--- a/Source/devtools/front_end/sdk/DebuggerModel.js
+++ b/Source/devtools/front_end/sdk/DebuggerModel.js
@@ -56,6 +56,7 @@
WebInspector.settings.enableAsyncStackTraces.addChangeListener(this.asyncStackTracesStateChanged, this);
WebInspector.settings.skipStackFramesPattern.addChangeListener(this._applySkipStackFrameSettings, this);
WebInspector.settings.skipContentScripts.addChangeListener(this._applySkipStackFrameSettings, this);
+ WebInspector.settings.disablePausedStateOverlay.addChangeListener(this._updateOverlayMessage, this);
this.enableDebugger();
@@ -203,27 +204,62 @@
stepInto: function()
{
- this._agent.stepInto();
+ /**
+ * @this {WebInspector.DebuggerModel}
+ */
+ function callback()
+ {
+ this._agent.stepInto();
+ }
+ this._setOverlayMessage(undefined).then(callback.bind(this));
},
stepIntoAsync: function()
{
- this._agent.stepIntoAsync();
+ /**
+ * @this {WebInspector.DebuggerModel}
+ */
+ function callback()
+ {
+ this._agent.stepIntoAsync();
+ }
+ this._setOverlayMessage(undefined).then(callback.bind(this));
},
stepOver: function()
{
- this._agent.stepOver();
+ /**
+ * @this {WebInspector.DebuggerModel}
+ */
+ function callback()
+ {
+ this._agent.stepOver();
+ }
+ this._setOverlayMessage(undefined).then(callback.bind(this));
},
stepOut: function()
{
- this._agent.stepOut();
+ /**
+ * @this {WebInspector.DebuggerModel}
+ */
+ function callback()
+ {
+ this._agent.stepOut();
+ }
+ this._setOverlayMessage(undefined).then(callback.bind(this));
},
resume: function()
{
- this._agent.resume();
+ /**
+ * @this {WebInspector.DebuggerModel}
+ */
+ function callback()
+ {
+ this._agent.resume();
+ }
+ this._setOverlayMessage(undefined).then(callback.bind(this));
this._isPausing = false;
},
@@ -449,6 +485,35 @@
this.setSelectedCallFrame(debuggerPausedDetails.callFrames[0]);
else
this.setSelectedCallFrame(null);
+ this._updateOverlayMessage();
+ },
+
+ _updateOverlayMessage: function()
+ {
+ var message = this._debuggerPausedDetails && !WebInspector.settings.disablePausedStateOverlay.get() ? WebInspector.UIString("Paused in debugger") : undefined;
+ this._setOverlayMessage(message);
+ },
+
+ /**
+ * @param {string=} message
+ * @return {!Promise.<undefined>}
+ */
+ _setOverlayMessage: function(message)
+ {
+ /**
+ * @param {function(?):?} fulfill
+ * @param {function(*):?} reject
+ * @this {WebInspector.DebuggerModel}
+ */
+ function setOverlayMessagePromiseCallback(fulfill, reject)
+ {
+ var pageAgent = this.target().pageAgent();
+ if (pageAgent)
+ pageAgent.setOverlayMessage(message, fulfill);
+ else
+ fulfill(undefined);
+ }
+ return new Promise(setOverlayMessagePromiseCallback.bind(this));
},
/**
« no previous file with comments | « Source/devtools/front_end/main/module.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698