| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.VBox} | 7 * @extends {WebInspector.VBox} |
| 8 * @implements {WebInspector.TargetManager.Observer} | 8 * @implements {WebInspector.TargetManager.Observer} |
| 9 */ | 9 */ |
| 10 WebInspector.ServiceWorkersView = function() | 10 WebInspector.ServiceWorkersView = function() |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 * @override | 36 * @override |
| 37 * @param {!WebInspector.Target} target | 37 * @param {!WebInspector.Target} target |
| 38 */ | 38 */ |
| 39 targetAdded: function(target) | 39 targetAdded: function(target) |
| 40 { | 40 { |
| 41 if (this._target) | 41 if (this._target) |
| 42 return; | 42 return; |
| 43 this._target = target; | 43 this._target = target; |
| 44 this._manager = this._target.serviceWorkerManager; | 44 this._manager = this._target.serviceWorkerManager; |
| 45 | 45 |
| 46 var forceUpdate = new WebInspector.ToolbarCheckbox(WebInspector.UIString
("Update on reload"), WebInspector.UIString("Update Service Worker on page reloa
d"), this._manager.forceUpdateOnReloadSetting()); | 46 var forceUpdate = new WebInspector.ToolbarCheckbox(WebInspector.UIString
("Update worker on reload"), WebInspector.UIString("Update Service Worker on pag
e reload"), this._manager.forceUpdateOnReloadSetting()); |
| 47 this._toolbar.appendToolbarItem(forceUpdate); | 47 this._toolbar.appendToolbarItem(forceUpdate); |
| 48 | 48 var fallbackToNetwork = new WebInspector.ToolbarCheckbox(WebInspector.UI
String("Bypass worker for network"), WebInspector.UIString("Bypass Service Worke
r and load resources from the network"), target.networkManager.bypassServiceWork
erSetting()); |
| 49 this._showAllCheckbox = new WebInspector.ToolbarCheckbox(WebInspector.UI
String("Show all"), WebInspector.UIString("Show all Service Workers")); | 49 this._toolbar.appendToolbarItem(fallbackToNetwork); |
| 50 this._toolbar.appendSpacer(); |
| 51 this._showAllCheckbox = new WebInspector.ToolbarCheckbox(WebInspector.UI
String("Show all"), WebInspector.UIString("Show all Service Workers regardless o
f the scope")); |
| 50 this._showAllCheckbox.inputElement.addEventListener("change", this._onSh
owAllCheckboxChanged.bind(this), false); | 52 this._showAllCheckbox.inputElement.addEventListener("change", this._onSh
owAllCheckboxChanged.bind(this), false); |
| 51 this._toolbar.appendToolbarItem(this._showAllCheckbox); | 53 this._toolbar.appendToolbarItem(this._showAllCheckbox); |
| 52 | 54 |
| 53 for (var registration of this._manager.registrations().values()) | 55 for (var registration of this._manager.registrations().values()) |
| 54 this._updateRegistration(registration); | 56 this._updateRegistration(registration); |
| 55 | 57 |
| 56 this._manager.addEventListener(WebInspector.ServiceWorkerManager.Events.
RegistrationUpdated, this._registrationUpdated, this); | 58 this._manager.addEventListener(WebInspector.ServiceWorkerManager.Events.
RegistrationUpdated, this._registrationUpdated, this); |
| 57 this._manager.addEventListener(WebInspector.ServiceWorkerManager.Events.
RegistrationDeleted, this._registrationDeleted, this); | 59 this._manager.addEventListener(WebInspector.ServiceWorkerManager.Events.
RegistrationDeleted, this._registrationDeleted, this); |
| 58 this._target.resourceTreeModel.addEventListener(WebInspector.ResourceTre
eModel.EventTypes.SecurityOriginAdded, this._securityOriginAdded, this); | 60 this._target.resourceTreeModel.addEventListener(WebInspector.ResourceTre
eModel.EventTypes.SecurityOriginAdded, this._securityOriginAdded, this); |
| 59 this._target.resourceTreeModel.addEventListener(WebInspector.ResourceTre
eModel.EventTypes.SecurityOriginRemoved, this._securityOriginRemoved, this); | 61 this._target.resourceTreeModel.addEventListener(WebInspector.ResourceTre
eModel.EventTypes.SecurityOriginRemoved, this._securityOriginRemoved, this); |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 * @param {string} versionId | 587 * @param {string} versionId |
| 586 * @param {!Event} event | 588 * @param {!Event} event |
| 587 */ | 589 */ |
| 588 _inspectButtonClicked: function(versionId, event) | 590 _inspectButtonClicked: function(versionId, event) |
| 589 { | 591 { |
| 590 this._manager.inspectWorker(versionId); | 592 this._manager.inspectWorker(versionId); |
| 591 }, | 593 }, |
| 592 | 594 |
| 593 __proto__: WebInspector.VBox.prototype | 595 __proto__: WebInspector.VBox.prototype |
| 594 } | 596 } |
| OLD | NEW |