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

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

Issue 1841863003: DevTools: move the force update SW on reload checkbox to the Resources / Service Workers view. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/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 3c74e03b1a248ff1192a1f399429fc946ddcab04..65ae22221b9d8e1ab73c1b36bf712ee4448a57e6 100644
--- a/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js
+++ b/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js
@@ -20,13 +20,7 @@ WebInspector.ServiceWorkersView = function()
/** @type {!Map.<string, !WebInspector.ServiceWorkerOriginWidget>} */
this._registrationIdToOriginWidgetMap = new Map();
- var settingsDiv = createElementWithClass("div", "service-workers-settings");
- var debugOnStartCheckboxLabel = createCheckboxLabel(WebInspector.UIString("Open DevTools window and pause JavaScript execution on Service Worker startup for debugging."));
horo 2016/03/30 05:17:35 Why do you remove this debugOnStartCheckbox?
pfeldman 2016/03/30 17:11:44 It does not currently work in combination with the
horo 2016/03/31 02:39:45 OK. Sounds reasonable. Please write about this in
- this._debugOnStartCheckbox = debugOnStartCheckboxLabel.checkboxElement;
- this._debugOnStartCheckbox.addEventListener("change", this._debugOnStartCheckboxChanged.bind(this), false)
- this._debugOnStartCheckbox.disabled = true
- settingsDiv.appendChild(debugOnStartCheckboxLabel);
- this.contentElement.appendChild(settingsDiv);
+ this._toolbar = new WebInspector.Toolbar("", this.contentElement);
this._root = this.contentElement.createChild("div");
this._root.classList.add("service-workers-root");
@@ -46,14 +40,14 @@ WebInspector.ServiceWorkersView.prototype = {
this._target = target;
this._manager = this._target.serviceWorkerManager;
- this._debugOnStartCheckbox.disabled = false;
- this._debugOnStartCheckbox.checked = this._manager.debugOnStart();
+ var forceUpdate = new WebInspector.ToolbarCheckbox(WebInspector.UIString("Update on reload"), WebInspector.UIString("Update Service Worker on page reload"), this._manager.forceUpdateOnReloadSetting());
+ this._toolbar.appendToolbarItem(forceUpdate);
+
for (var registration of this._manager.registrations().values())
this._updateRegistration(registration);
this._manager.addEventListener(WebInspector.ServiceWorkerManager.Events.RegistrationUpdated, this._registrationUpdated, this);
this._manager.addEventListener(WebInspector.ServiceWorkerManager.Events.RegistrationDeleted, this._registrationDeleted, this);
- this._manager.addEventListener(WebInspector.ServiceWorkerManager.Events.DebugOnStartUpdated, this._debugOnStartUpdated, this);
this._target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.SecurityOriginAdded, this._securityOriginAdded, this);
this._target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.SecurityOriginRemoved, this._securityOriginRemoved, this);
var securityOrigins = this._target.resourceTreeModel.securityOrigins();
@@ -123,15 +117,6 @@ WebInspector.ServiceWorkersView.prototype = {
/**
* @param {!WebInspector.Event} event
*/
- _debugOnStartUpdated: function(event)
- {
- var debugOnStart = /** @type {boolean} */ (event.data);
- this._debugOnStartCheckbox.checked = debugOnStart;
- },
-
- /**
- * @param {!WebInspector.Event} event
- */
_securityOriginAdded: function(event)
{
this._addOrigin(/** @type {string} */ (event.data));
@@ -174,14 +159,6 @@ WebInspector.ServiceWorkersView.prototype = {
originWidget.detach();
},
- _debugOnStartCheckboxChanged: function()
- {
- if (!this._manager)
- return;
- this._manager.setDebugOnStart(this._debugOnStartCheckbox.checked);
dgozman 2016/03/30 21:09:54 Remove it from manager, protocol and backend.
pfeldman 2016/03/31 05:02:31 Done.
- this._debugOnStartCheckbox.checked = this._manager.debugOnStart();
- },
-
__proto__: WebInspector.VBox.prototype
}

Powered by Google App Engine
This is Rietveld 408576698