OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> | 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> |
4 * Copyright (C) 2011 Google Inc. All rights reserved. | 4 * Copyright (C) 2011 Google Inc. All rights reserved. |
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 SDK.ResourceTreeModel, SDK.ResourceTreeModel.Events.WillReloadPage, this ._willReloadPage, this); | 100 SDK.ResourceTreeModel, SDK.ResourceTreeModel.Events.WillReloadPage, this ._willReloadPage, this); |
101 SDK.targetManager.addModelListener(SDK.ResourceTreeModel, SDK.ResourceTreeMo del.Events.Load, this._load, this); | 101 SDK.targetManager.addModelListener(SDK.ResourceTreeModel, SDK.ResourceTreeMo del.Events.Load, this._load, this); |
102 this._networkLogView.addEventListener(Network.NetworkLogView.Events.RequestS elected, this._onRequestSelected, this); | 102 this._networkLogView.addEventListener(Network.NetworkLogView.Events.RequestS elected, this._onRequestSelected, this); |
103 this._networkLogView.addEventListener( | 103 this._networkLogView.addEventListener( |
104 Network.NetworkLogView.Events.SearchCountUpdated, this._onSearchCountUpd ated, this); | 104 Network.NetworkLogView.Events.SearchCountUpdated, this._onSearchCountUpd ated, this); |
105 this._networkLogView.addEventListener( | 105 this._networkLogView.addEventListener( |
106 Network.NetworkLogView.Events.SearchIndexUpdated, this._onSearchIndexUpd ated, this); | 106 Network.NetworkLogView.Events.SearchIndexUpdated, this._onSearchIndexUpd ated, this); |
107 this._networkLogView.addEventListener(Network.NetworkLogView.Events.UpdateRe quest, this._onUpdateRequest, this); | 107 this._networkLogView.addEventListener(Network.NetworkLogView.Events.UpdateRe quest, this._onUpdateRequest, this); |
108 | 108 |
109 Components.DataSaverInfobar.maybeShowInPanel(this); | 109 Components.DataSaverInfobar.maybeShowInPanel(this); |
110 | |
111 var manager = SDK.multitargetNetworkManager; | |
112 manager.on(SDK.MultitargetNetworkManager.RequestBlockingEnabledChangedEvent, updateVisibility); | |
113 manager.addEventListener(SDK.MultitargetNetworkManager.Events.ConditionsChan ged, updateVisibility); | |
114 var blockedURLsSetting = Common.moduleSetting('networkBlockedURLs'); | |
115 blockedURLsSetting.addChangeListener(updateVisibility); | |
116 | |
117 function updateVisibility() { | |
118 var icon = null; | |
119 if (manager.isThrottling()) { | |
120 icon = UI.Icon.create('smallicon-warning'); | |
121 icon.title = Common.UIString('Network throttling is enabled'); | |
122 } else if (SDK.multitargetNetworkManager.isRequestBlockingEnabled() && blo ckedURLsSetting.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
| |
123 icon = UI.Icon.create('smallicon-warning'); | |
124 icon.title = Common.UIString('Requests may be blocked'); | |
125 } | |
126 UI.inspectorView.setPanelIcon('network', icon); | |
pfeldman
2017/02/13 18:24:26
this.name
allada
2017/02/16 21:42:03
Done.
| |
127 } | |
110 } | 128 } |
111 | 129 |
112 /** | 130 /** |
113 * @param {!Array<{filterType: !Network.NetworkLogView.FilterType, filterValue : string}>} filters | 131 * @param {!Array<{filterType: !Network.NetworkLogView.FilterType, filterValue : string}>} filters |
114 */ | 132 */ |
115 static revealAndFilter(filters) { | 133 static revealAndFilter(filters) { |
116 var panel = Network.NetworkPanel._instance(); | 134 var panel = Network.NetworkPanel._instance(); |
117 var filterString = ''; | 135 var filterString = ''; |
118 for (var filter of filters) | 136 for (var filter of filters) |
119 filterString += `${filter.filterType}:${filter.filterValue} `; | 137 filterString += `${filter.filterType}:${filter.filterValue} `; |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
726 * @param {string} actionId | 744 * @param {string} actionId |
727 * @return {boolean} | 745 * @return {boolean} |
728 */ | 746 */ |
729 handleAction(context, actionId) { | 747 handleAction(context, actionId) { |
730 var panel = UI.context.flavor(Network.NetworkPanel); | 748 var panel = UI.context.flavor(Network.NetworkPanel); |
731 console.assert(panel && panel instanceof Network.NetworkPanel); | 749 console.assert(panel && panel instanceof Network.NetworkPanel); |
732 panel._toggleRecording(); | 750 panel._toggleRecording(); |
733 return true; | 751 return true; |
734 } | 752 } |
735 }; | 753 }; |
OLD | NEW |