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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/main/Main.js

Issue 2691433006: [Devtools] Persist network request blocking (Closed)
Patch Set: Merge branch 'ADD_ENABLE_DISABLE_REQUEST_BLOCKINg' into BLOCK_REQUESTS_IN_NETWORK_PERSISTANT Created 3 years, 10 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 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com).
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 /** 748 /**
749 * @unrestricted 749 * @unrestricted
750 */ 750 */
751 Main.NetworkPanelIndicator = class { 751 Main.NetworkPanelIndicator = class {
752 constructor() { 752 constructor() {
753 // TODO: we should not access network from other modules. 753 // TODO: we should not access network from other modules.
754 if (!UI.inspectorView.hasPanel('network')) 754 if (!UI.inspectorView.hasPanel('network'))
755 return; 755 return;
756 var manager = SDK.multitargetNetworkManager; 756 var manager = SDK.multitargetNetworkManager;
757 manager.addEventListener(SDK.MultitargetNetworkManager.Events.ConditionsChan ged, updateVisibility); 757 manager.addEventListener(SDK.MultitargetNetworkManager.Events.ConditionsChan ged, updateVisibility);
758 var blockedURLsSetting = Common.moduleSetting('blockedURLs'); 758 var blockedURLsSetting = Common.moduleSetting('networkBlockedURLs');
pfeldman 2017/02/11 02:45:05 Move into Network module, also map it to the new e
allada 2017/02/11 05:02:04 Done.
759 blockedURLsSetting.addChangeListener(updateVisibility); 759 blockedURLsSetting.addChangeListener(updateVisibility);
760 SDK.multitargetNetworkManager.on( 760 SDK.multitargetNetworkManager.on(
761 SDK.MultitargetNetworkManager.RequestBlockingEnabledChangedEvent, update Visibility); 761 SDK.MultitargetNetworkManager.RequestBlockingEnabledChangedEvent, update Visibility);
762 updateVisibility(); 762 updateVisibility();
763 763
764 function updateVisibility() { 764 function updateVisibility() {
765 var icon = null; 765 var icon = null;
766 if (manager.isThrottling()) { 766 if (manager.isThrottling()) {
767 icon = UI.Icon.create('smallicon-warning'); 767 icon = UI.Icon.create('smallicon-warning');
768 icon.title = Common.UIString('Network throttling is enabled'); 768 icon.title = Common.UIString('Network throttling is enabled');
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 * @override 978 * @override
979 * @return {?Element} 979 * @return {?Element}
980 */ 980 */
981 settingElement() { 981 settingElement() {
982 return UI.SettingsUI.createSettingCheckbox( 982 return UI.SettingsUI.createSettingCheckbox(
983 Common.UIString('Show rulers'), Common.moduleSetting('showMetricsRulers' )); 983 Common.UIString('Show rulers'), Common.moduleSetting('showMetricsRulers' ));
984 } 984 }
985 }; 985 };
986 986
987 new Main.Main(); 987 new Main.Main();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698