Chromium Code Reviews| Index: Source/devtools/front_end/network/NetworkPanel.js |
| diff --git a/Source/devtools/front_end/network/NetworkPanel.js b/Source/devtools/front_end/network/NetworkPanel.js |
| index 61e8da516ba3d17df1f24ebf762cd80f8355d471..e187ffa537be3ab270b20762d33c7cf8e141359c 100644 |
| --- a/Source/devtools/front_end/network/NetworkPanel.js |
| +++ b/Source/devtools/front_end/network/NetworkPanel.js |
| @@ -52,11 +52,6 @@ WebInspector.NetworkPanel = function() |
| this._filterBar = new WebInspector.FilterBar("networkPanel", true); |
| this.element.appendChild(this._filterBar.filtersElement()); |
| - if (Runtime.experiments.isEnabled("blockedURLs")) { |
| - this._blockedURLsBar = new WebInspector.BlockedURLsBar(); |
| - this.element.appendChild(this._blockedURLsBar.element); |
| - } |
| - |
| this._searchableView = new WebInspector.SearchableView(this); |
| this._searchableView.setPlaceholder(WebInspector.UIString("Find by filename or path")); |
| this._searchableView.show(this.element); |
| @@ -88,6 +83,13 @@ WebInspector.NetworkPanel = function() |
| this._closeButtonElement = createElementWithClass("div", "network-close-button", "dt-close-button"); |
| this._closeButtonElement.addEventListener("click", this._showRequest.bind(this, null), false); |
| + if (Runtime.experiments.isEnabled("blockedURLs")) { |
|
pfeldman
2015/08/28 17:15:49
Looks good enough to leave the experiment to me.
dgozman
2015/08/31 21:17:39
Done.
|
| + this._blockedURLsPane = new WebInspector.BlockedURLsPane(); |
| + this._filterBar.addFilter(this._blockedURLsPane.filterUI()); |
| + this._filterBar.addEventListener(WebInspector.FilterBar.Events.Toggled, this._toggleBlockedURLsSidebarPane, this); |
| + this._toggleBlockedURLsSidebarPane(); |
| + } |
| + |
| this._networkLogShowOverviewSetting.addChangeListener(this._toggleShowOverview, this); |
| this._networkLogLargeRowsSetting.addChangeListener(this._toggleLargerRequests, this); |
| this._networkRecordFilmStripSetting.addChangeListener(this._toggleRecordFilmStrip, this); |
| @@ -162,8 +164,6 @@ WebInspector.NetworkPanel.prototype = { |
| this._panelToolbar.appendToolbarItem(this._disableCacheCheckbox); |
| this._panelToolbar.appendSeparator(); |
| - if (Runtime.experiments.isEnabled("blockedURLs")) |
| - this._panelToolbar.appendToolbarItem(this._blockedURLsBar.toolbarButton()); |
| this._panelToolbar.appendToolbarItem(this._createNetworkConditionsSelect()); |
| this._panelToolbar.appendToolbarItem(new WebInspector.ToolbarItem(this._progressBarContainer)); |
| }, |
| @@ -246,6 +246,8 @@ WebInspector.NetworkPanel.prototype = { |
| this._calculator.reset(); |
| this._overviewPane.reset(); |
| this._networkLogView.reset(); |
| + if (Runtime.experiments.isEnabled("blockedURLs")) |
| + this._blockedURLsPane.reset(); |
| if (this._filmStripView) |
| this._resetFilmStripView(); |
| }, |
| @@ -286,6 +288,16 @@ WebInspector.NetworkPanel.prototype = { |
| this.doResize(); |
| }, |
| + _toggleBlockedURLsSidebarPane: function() |
| + { |
| + var toggled = this._filterBar.filtersToggled(); |
| + if (toggled) |
| + this._blockedURLsPane.show(this._searchableView.element); |
| + else |
| + this._blockedURLsPane.detach(); |
| + this.doResize(); |
| + }, |
| + |
| _toggleRecordFilmStrip: function() |
| { |
| var toggled = this._networkRecordFilmStripSetting.get(); |
| @@ -745,61 +757,3 @@ WebInspector.NetworkPanel.FilmStripRecorder.prototype = { |
| this._filmStripView.setStatusText(WebInspector.UIString("Fetching frames...")); |
| } |
| } |
| - |
| -/** |
| - * @constructor |
| - */ |
| -WebInspector.BlockedURLsBar = function() |
| -{ |
| - this.element = createElementWithClass("div", "blocked-urls-bar"); |
| - |
| - this._toolbarButton = new WebInspector.ToolbarButton(WebInspector.UIString("Manage blocked URLs"), "filter-toolbar-item", 3); |
| - this._toolbarButton.addEventListener("click", this._toggleVisibility, this); |
| - |
| - this._manager = WebInspector.multitargetNetworkManager; |
| - this._manager.addEventListener(WebInspector.MultitargetNetworkManager.EventTypes.BlockedURLsChanged, this._update, this); |
| - |
| - this._visible = true; |
| - this._toggleVisibility(); |
| - this._update(); |
| -} |
| - |
| -WebInspector.BlockedURLsBar.prototype = { |
| - _updateToolbarButton: function() |
| - { |
| - this._toolbarButton.setState(this._visible ? "shown" : (this._manager.blockedURLs().size ? "active" : "inactive")); |
| - }, |
| - |
| - _update: function() |
| - { |
| - this._updateToolbarButton(); |
| - |
| - this.element.removeChildren(); |
| - for (var url of this._manager.blockedURLs()) { |
| - var container = this.element.createChild("div", "blocked-url-container"); |
| - var text = container.createChild("div", "blocked-url-text"); |
| - text.textContent = url; |
| - text.title = url; |
| - var closeButton = container.createChild("div", "close-button", "dt-close-button"); |
| - closeButton.addEventListener("click", this._manager.toggleURLBlocked.bind(this._manager, url), false); |
| - closeButton.gray = true; |
| - } |
| - if (!this._manager.blockedURLs().size) |
| - this.element.createChild("div", "blocked-urls-empty").textContent = WebInspector.UIString("No blocked URLs."); |
| - }, |
| - |
| - _toggleVisibility: function() |
| - { |
| - this._visible = !this._visible; |
| - this.element.classList.toggle("hidden", !this._visible); |
| - this._updateToolbarButton(); |
| - }, |
| - |
| - /** |
| - * @return {!WebInspector.ToolbarButton} |
| - */ |
| - toolbarButton: function() |
| - { |
| - return this._toolbarButton; |
| - } |
| -} |