Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/network/NetworkPanel.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkPanel.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkPanel.js |
| index e3eda70ec4c1382bcd4dd31871f89dbe12c32063..3f01c504e0b6ce40d17a7ceaa04ca9ed359a208c 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/network/NetworkPanel.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkPanel.js |
| @@ -107,6 +107,24 @@ Network.NetworkPanel = class extends UI.Panel { |
| this._networkLogView.addEventListener(Network.NetworkLogView.Events.UpdateRequest, this._onUpdateRequest, this); |
| Components.DataSaverInfobar.maybeShowInPanel(this); |
| + |
| + var manager = SDK.multitargetNetworkManager; |
| + manager.on(SDK.MultitargetNetworkManager.RequestBlockingEnabledChangedEvent, updateVisibility); |
| + manager.addEventListener(SDK.MultitargetNetworkManager.Events.ConditionsChanged, updateVisibility); |
| + var blockedURLsSetting = Common.moduleSetting('networkBlockedURLs'); |
| + blockedURLsSetting.addChangeListener(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 (SDK.multitargetNetworkManager.isRequestBlockingEnabled() && blockedURLsSetting.get().length) { |
|
pfeldman
2017/02/13 18:24:26
You don't need to check the blocked url length. se
allada
2017/02/16 21:42:02
I thought it'd be better to allow the user to keep
|
| + icon = UI.Icon.create('smallicon-warning'); |
| + icon.title = Common.UIString('Requests may be blocked'); |
| + } |
| + UI.inspectorView.setPanelIcon('network', icon); |
|
pfeldman
2017/02/13 18:24:26
this.name
allada
2017/02/16 21:42:03
Done.
|
| + } |
| } |
| /** |