| 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 * @implements {SDK.SDKModelObserver<!SDK.ServiceWorkerManager>} | 5 * @implements {SDK.SDKModelObserver<!SDK.ServiceWorkerManager>} |
| 6 * @unrestricted | 6 * @unrestricted |
| 7 */ | 7 */ |
| 8 Resources.ServiceWorkersView = class extends UI.VBox { | 8 Resources.ServiceWorkersView = class extends UI.VBox { |
| 9 constructor() { | 9 constructor() { |
| 10 super(true); | 10 super(true); |
| 11 | 11 |
| 12 this._reportView = new UI.ReportView(Common.UIString('Service Workers')); | 12 this._reportView = new UI.ReportView(Common.UIString('Service Workers')); |
| 13 this._reportView.show(this.contentElement); | 13 this._reportView.show(this.contentElement); |
| 14 | 14 |
| 15 this._toolbar = this._reportView.createToolbar(); | 15 this._toolbar = this._reportView.createToolbar(); |
| 16 this._toolbar.makeWrappable(false, true); | 16 this._toolbar.makeWrappable(false, true); |
| 17 | 17 |
| 18 /** @type {!Map<!SDK.ServiceWorkerRegistration, !Resources.ServiceWorkersVie
w.Section>} */ | 18 /** @type {!Map<!SDK.ServiceWorkerRegistration, !Resources.ServiceWorkersVie
w.Section>} */ |
| 19 this._sections = new Map(); | 19 this._sections = new Map(); |
| 20 | 20 |
| 21 this._toolbar.appendToolbarItem(MobileThrottling.NetworkConditionsSelector.c
reateOfflineToolbarCheckbox()); | 21 this._toolbar.appendToolbarItem(MobileThrottling.throttlingManager().createO
fflineToolbarCheckbox()); |
| 22 var updateOnReloadSetting = Common.settings.createSetting('serviceWorkerUpda
teOnReload', false); | 22 var updateOnReloadSetting = Common.settings.createSetting('serviceWorkerUpda
teOnReload', false); |
| 23 updateOnReloadSetting.setTitle(Common.UIString('Update on reload')); | 23 updateOnReloadSetting.setTitle(Common.UIString('Update on reload')); |
| 24 var forceUpdate = new UI.ToolbarSettingCheckbox( | 24 var forceUpdate = new UI.ToolbarSettingCheckbox( |
| 25 updateOnReloadSetting, Common.UIString('Force update Service Worker on p
age reload')); | 25 updateOnReloadSetting, Common.UIString('Force update Service Worker on p
age reload')); |
| 26 this._toolbar.appendToolbarItem(forceUpdate); | 26 this._toolbar.appendToolbarItem(forceUpdate); |
| 27 var bypassServiceWorkerSetting = Common.settings.createSetting('bypassServic
eWorker', false); | 27 var bypassServiceWorkerSetting = Common.settings.createSetting('bypassServic
eWorker', false); |
| 28 bypassServiceWorkerSetting.setTitle(Common.UIString('Bypass for network')); | 28 bypassServiceWorkerSetting.setTitle(Common.UIString('Bypass for network')); |
| 29 var fallbackToNetwork = new UI.ToolbarSettingCheckbox( | 29 var fallbackToNetwork = new UI.ToolbarSettingCheckbox( |
| 30 bypassServiceWorkerSetting, Common.UIString('Bypass Service Worker and l
oad resources from the network')); | 30 bypassServiceWorkerSetting, Common.UIString('Bypass Service Worker and l
oad resources from the network')); |
| 31 this._toolbar.appendToolbarItem(fallbackToNetwork); | 31 this._toolbar.appendToolbarItem(fallbackToNetwork); |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 * @return {!Element} | 455 * @return {!Element} |
| 456 */ | 456 */ |
| 457 _wrapWidget(container) { | 457 _wrapWidget(container) { |
| 458 var shadowRoot = UI.createShadowRootWithCoreStyles(container); | 458 var shadowRoot = UI.createShadowRootWithCoreStyles(container); |
| 459 UI.appendStyle(shadowRoot, 'resources/serviceWorkersView.css'); | 459 UI.appendStyle(shadowRoot, 'resources/serviceWorkersView.css'); |
| 460 var contentElement = createElement('div'); | 460 var contentElement = createElement('div'); |
| 461 shadowRoot.appendChild(contentElement); | 461 shadowRoot.appendChild(contentElement); |
| 462 return contentElement; | 462 return contentElement; |
| 463 } | 463 } |
| 464 }; | 464 }; |
| OLD | NEW |