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

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

Issue 2109813003: [DevTools] No NetworkManager and NetworkLog for v8only mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing code review comments Created 4 years, 5 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 /** 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 19 matching lines...) Expand all
30 targetAdded: function(target) 30 targetAdded: function(target)
31 { 31 {
32 if (this._target || !target.serviceWorkerManager) 32 if (this._target || !target.serviceWorkerManager)
33 return; 33 return;
34 this._target = target; 34 this._target = target;
35 this._manager = this._target.serviceWorkerManager; 35 this._manager = this._target.serviceWorkerManager;
36 36
37 this._toolbar.appendToolbarItem(WebInspector.NetworkConditionsSelector.c reateOfflineToolbarCheckbox()); 37 this._toolbar.appendToolbarItem(WebInspector.NetworkConditionsSelector.c reateOfflineToolbarCheckbox());
38 var forceUpdate = new WebInspector.ToolbarCheckbox(WebInspector.UIString ("Update on reload"), WebInspector.UIString("Force update Service Worker on page reload"), this._manager.forceUpdateOnReloadSetting()); 38 var forceUpdate = new WebInspector.ToolbarCheckbox(WebInspector.UIString ("Update on reload"), WebInspector.UIString("Force update Service Worker on page reload"), this._manager.forceUpdateOnReloadSetting());
39 this._toolbar.appendToolbarItem(forceUpdate); 39 this._toolbar.appendToolbarItem(forceUpdate);
40 var fallbackToNetwork = new WebInspector.ToolbarCheckbox(WebInspector.UI String("Bypass for network"), WebInspector.UIString("Bypass Service Worker and l oad resources from the network"), target.networkManager.bypassServiceWorkerSetti ng()); 40 var networkManager = this._target && WebInspector.NetworkManager.fromTar get(this._target);
41 this._toolbar.appendToolbarItem(fallbackToNetwork); 41 if (networkManager) {
42 this._toolbar.appendSpacer(); 42 var fallbackToNetwork = new WebInspector.ToolbarCheckbox(WebInspecto r.UIString("Bypass for network"), WebInspector.UIString("Bypass Service Worker a nd load resources from the network"), networkManager.bypassServiceWorkerSetting( ));
43 this._toolbar.appendToolbarItem(fallbackToNetwork);
44 this._toolbar.appendSpacer();
45 }
43 this._showAllCheckbox = new WebInspector.ToolbarCheckbox(WebInspector.UI String("Show all"), WebInspector.UIString("Show all Service Workers regardless o f the origin")); 46 this._showAllCheckbox = new WebInspector.ToolbarCheckbox(WebInspector.UI String("Show all"), WebInspector.UIString("Show all Service Workers regardless o f the origin"));
44 this._showAllCheckbox.inputElement.addEventListener("change", this._upda teSectionVisibility.bind(this), false); 47 this._showAllCheckbox.inputElement.addEventListener("change", this._upda teSectionVisibility.bind(this), false);
45 this._toolbar.appendToolbarItem(this._showAllCheckbox); 48 this._toolbar.appendToolbarItem(this._showAllCheckbox);
46 49
47 for (var registration of this._manager.registrations().values()) 50 for (var registration of this._manager.registrations().values())
48 this._updateRegistration(registration); 51 this._updateRegistration(registration);
49 52
50 this._manager.addEventListener(WebInspector.ServiceWorkerManager.Events. RegistrationUpdated, this._registrationUpdated, this); 53 this._manager.addEventListener(WebInspector.ServiceWorkerManager.Events. RegistrationUpdated, this._registrationUpdated, this);
51 this._manager.addEventListener(WebInspector.ServiceWorkerManager.Events. RegistrationDeleted, this._registrationDeleted, this); 54 this._manager.addEventListener(WebInspector.ServiceWorkerManager.Events. RegistrationDeleted, this._registrationDeleted, this);
52 this._manager.addEventListener(WebInspector.ServiceWorkerManager.Events. RegistrationErrorAdded, this._registrationErrorAdded, this); 55 this._manager.addEventListener(WebInspector.ServiceWorkerManager.Events. RegistrationErrorAdded, this._registrationErrorAdded, this);
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 return contentElement; 406 return contentElement;
404 }, 407 },
405 408
406 _dispose: function() 409 _dispose: function()
407 { 410 {
408 this._linkifier.dispose(); 411 this._linkifier.dispose();
409 if (this._pendingUpdate) 412 if (this._pendingUpdate)
410 clearTimeout(this._pendingUpdate); 413 clearTimeout(this._pendingUpdate);
411 } 414 }
412 } 415 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698