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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js

Issue 2623143002: DevTools: insert console message decorations in order
Patch Set: address design comments Created 3 years, 11 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: third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
index ebfcb1feb6d6ac7017e75158ed000ff4e0d40de0..e17a7ba2d5aec9d9a0e9936b4ab498735e38740c 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
@@ -457,6 +457,10 @@ SDK.ExecutionContext = class extends SDK.SDKObject {
this.frameId = frameId;
this._label = name;
+ /** @type {string|undefined} */
+ this._versionId;
allada 2017/01/19 02:38:08 nit: lets make these empty strings when undefined.
luoe 2017/01/19 23:22:59 Done.
+ /** @type {string|undefined} */
+ this._versionStatus;
var parsedUrl = origin.asParsedURL();
if (!this._label && parsedUrl)
this._label = parsedUrl.lastPathComponentWithFragment();
@@ -573,17 +577,27 @@ SDK.ExecutionContext = class extends SDK.SDKObject {
}
/**
+ * @param {boolean} showStatus
* @return {string}
*/
- label() {
- return this._label;
+ label(showStatus) {
+ var text = this._versionId ? this._label + ' #' + this._versionId : this._label;
+ if (this._versionStatus && showStatus)
+ return text + ' (' + this._versionStatus + ')';
+ return text;
}
/**
* @param {string} label
+ * @param {string=} versionId
+ * @param {string=} versionStatus
*/
- setLabel(label) {
+ setLabel(label, versionId, versionStatus) {
this._label = label;
+ if (versionId)
+ this._versionId = versionId;
+ if (versionStatus)
+ this._versionStatus = versionStatus;
this.runtimeModel.dispatchEventToListeners(SDK.RuntimeModel.Events.ExecutionContextChanged, this);
}
};

Powered by Google App Engine
This is Rietveld 408576698