| Index: third_party/WebKit/Source/devtools/front_end/main/Main.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/main/Main.js b/third_party/WebKit/Source/devtools/front_end/main/Main.js
|
| index 0dc04d7b98465cf8340759cd69fc87a2b51b4098..411726f7c4b735c8c66bbea6366e124946c39132 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/main/Main.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/main/Main.js
|
| @@ -201,6 +201,7 @@ Main.Main = class {
|
|
|
| new Main.Main.PauseListener();
|
| new Main.Main.InspectedNodeRevealer();
|
| + new Main.NetworkPanelIndicator();
|
| new Main.SourcesPanelIndicator();
|
| new Main.BackendSettingsSync();
|
| Components.domBreakpointsSidebarPane = new Components.DOMBreakpointsSidebarPane();
|
| @@ -750,6 +751,33 @@ Main.Main.MainMenuItem = class {
|
| }
|
| };
|
|
|
| +Main.NetworkPanelIndicator = class {
|
| + constructor() {
|
| + // TODO: we should not access network from other modules.
|
| + if (!UI.inspectorView.hasPanel('network'))
|
| + return;
|
| + var manager = SDK.multitargetNetworkManager;
|
| + manager.addEventListener(SDK.MultitargetNetworkManager.Events.ConditionsChanged, updateVisibility);
|
| + var blockedURLsSetting = Common.moduleSetting('networkBlockedURLs');
|
| + blockedURLsSetting.addChangeListener(updateVisibility);
|
| + var requestBlockingEnabledSetting = Common.moduleSetting('requestBlockingEnabled');
|
| + requestBlockingEnabledSetting.addChangeListener(updateVisibility);
|
| + updateVisibility();
|
| +
|
| + function updateVisibility() {
|
| + var icon = null;
|
| + if (manager.isThrottling()) {
|
| + icon = UI.Icon.create('smallicon-warning');
|
| + icon.title = Common.UIString('Network throttling is enabled');
|
| + } else if (requestBlockingEnabledSetting.get() && blockedURLsSetting.get().length) {
|
| + icon = UI.Icon.create('smallicon-warning');
|
| + icon.title = Common.UIString('Requests may be blocked');
|
| + }
|
| + UI.inspectorView.setPanelIcon('network', icon);
|
| + }
|
| + }
|
| +};
|
| +
|
| /**
|
| * @unrestricted
|
| */
|
|
|