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

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

Issue 2915883002: DevTools: prepare to unify Network and CPU throttling UI (Closed)
Patch Set: gs Created 3 years, 6 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 unified diff | Download patch
OLDNEW
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(NetworkConditions.NetworkConditionsSelector. createOfflineToolbarCheckbox()); 21 this._toolbar.appendToolbarItem(MobileThrottling.NetworkConditionsSelector.c reateOfflineToolbarCheckbox());
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
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 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698