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

Unified Diff: third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js

Issue 1946333005: DevTools: follow up to v391774 with small UI fixes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js b/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js
index f045985656501e135d6dbe21e0af028b7bd23a91..90ba4d619f1f5ee33424a937174a5117257fbb76 100644
--- a/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js
+++ b/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js
@@ -211,12 +211,11 @@ WebInspector.ServiceWorkersView.Section.prototype = {
activeEntry.createChild("span").textContent = WebInspector.UIString("#%s active and is %s", active.id, active.runningStatus);
if (active.isRunning() || active.isStarting()) {
- var stopButton = createLink(activeEntry, WebInspector.UIString("stop"), this._stopButtonClicked.bind(this, active.id));
- if (!this._manager.targetForVersionId(active.id)) {
- var inspectButton = createLink(activeEntry, WebInspector.UIString("inspect"), this._inspectButtonClicked.bind(this, active.id));
- }
+ createLink(activeEntry, WebInspector.UIString("stop"), this._stopButtonClicked.bind(this, active.id));
+ if (!this._manager.targetForVersionId(active.id))
+ createLink(activeEntry, WebInspector.UIString("inspect"), this._inspectButtonClicked.bind(this, active.id));
} else if (active.isStartable()) {
- var startButton = createLink(activeEntry, WebInspector.UIString("start"), this._startButtonClicked.bind(this));
+ createLink(activeEntry, WebInspector.UIString("start"), this._startButtonClicked.bind(this));
}
var clientsList = this._wrapWidget(this._section.appendField(WebInspector.UIString("Clients")));
@@ -234,14 +233,18 @@ WebInspector.ServiceWorkersView.Section.prototype = {
var waitingEntry = versionsStack.createChild("div", "service-worker-version");
waitingEntry.createChild("div", "service-worker-waiting-circle");
waitingEntry.createChild("span").textContent = WebInspector.UIString("#%s waiting to activate", waiting.id);
- var skipButton = createLink(waitingEntry, WebInspector.UIString("skipWaiting"), this._skipButtonClicked.bind(this));
+ createLink(waitingEntry, WebInspector.UIString("skipWaiting"), this._skipButtonClicked.bind(this));
waitingEntry.createChild("div", "service-worker-subtitle").textContent = new Date(waiting.scriptLastModified * 1000).toLocaleString();
+ if (!this._manager.targetForVersionId(waiting.id) && (waiting.isRunning() || waiting.isStarting()))
+ createLink(waitingEntry, WebInspector.UIString("inspect"), this._inspectButtonClicked.bind(this, waiting.id));
}
if (installing) {
var installingEntry = versionsStack.createChild("div", "service-worker-version");
installingEntry.createChild("div", "service-worker-installing-circle");
installingEntry.createChild("span").textContent = WebInspector.UIString("#%s installing", installing.id);
installingEntry.createChild("div", "service-worker-subtitle").textContent = new Date(installing.scriptLastModified * 1000).toLocaleString();
+ if (!this._manager.targetForVersionId(installing.id) && (installing.isRunning() || installing.isStarting()))
+ createLink(installingEntry, WebInspector.UIString("inspect"), this._inspectButtonClicked.bind(this, installing.id));
}
this._section.setFieldVisible(WebInspector.UIString("Errors"), !!this._registration.errors.length);
@@ -250,18 +253,20 @@ WebInspector.ServiceWorkersView.Section.prototype = {
errorsLabel.classList.add("service-worker-errors-label");
errorsValue.appendChild(errorsLabel);
this._moreButton = createLink(errorsValue, this._errorsList.classList.contains("hidden") ? WebInspector.UIString("details") : WebInspector.UIString("hide"), this._moreErrorsButtonClicked.bind(this));
- var clearButton = createLink(errorsValue, WebInspector.UIString("clear"), this._clearErrorsButtonClicked.bind(this));
+ createLink(errorsValue, WebInspector.UIString("clear"), this._clearErrorsButtonClicked.bind(this));
/**
* @param {!Element} parent
* @param {string} title
* @param {function()} listener
+ * @return {!Element}
*/
function createLink(parent, title, listener)
{
var span = parent.createChild("span", "link");
span.textContent = title;
span.addEventListener("click", listener, false);
+ return span;
}
return Promise.resolve();
},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698