Commit b55d2e2c authored by eustas@chromium.org's avatar eustas@chromium.org

Persist filter bar state.

BUG=335712

Review URL: https://codereview.chromium.org/214523004

git-svn-id: svn://svn.chromium.org/blink/trunk@170283 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 1bf8d780
......@@ -70,6 +70,7 @@ WebInspector.ConsoleView = function(hideContextSelector)
this._filtersContainer = this._contentsElement.createChild("div", "console-filters-header hidden");
this._filtersContainer.appendChild(this._filterBar.filtersElement());
this._filterBar.addEventListener(WebInspector.FilterBar.Events.FiltersToggled, this._onFiltersToggled, this);
this._filterBar.setName("consoleView");
this._filter.addFilters(this._filterBar);
this.messagesElement = document.createElement("div");
......
......@@ -55,6 +55,15 @@ WebInspector.FilterBar.FilterBarState = {
};
WebInspector.FilterBar.prototype = {
/**
* @param {string} name
*/
setName: function(name)
{
this._stateSetting = WebInspector.settings.createSetting("filterBar-" + name + "-toggled", false);
this._setState(this._stateSetting.get());
},
/**
* @return {!WebInspector.StatusBarButton}
*/
......@@ -123,7 +132,21 @@ WebInspector.FilterBar.prototype = {
*/
_handleFilterButtonClick: function(event)
{
this._filtersShown = !this._filtersShown;
this._setState(!this._filtersShown);
},
/**
* @param {boolean} filtersShown
*/
_setState: function(filtersShown)
{
if (this._filtersShown === filtersShown)
return;
this._filtersShown = filtersShown;
if (this._stateSetting)
this._stateSetting.set(filtersShown);
this._updateFilterButton();
this.dispatchEventToListeners(WebInspector.FilterBar.Events.FiltersToggled, this._filtersShown);
if (this._filtersShown) {
......
......@@ -1674,6 +1674,7 @@ WebInspector.NetworkPanel = function()
this._filtersContainer = this.element.createChild("div", "network-filters-header hidden");
this._filtersContainer.appendChild(this._filterBar.filtersElement());
this._filterBar.addEventListener(WebInspector.FilterBar.Events.FiltersToggled, this._onFiltersToggled, this);
this._filterBar.setName("networkPanel");
this._searchableView = new WebInspector.SearchableView(this);
this._searchableView.show(this.element);
......
......@@ -337,6 +337,7 @@ WebInspector.TimelinePanel.prototype = {
this._filtersContainer = this.element.createChild("div", "timeline-filters-header hidden");
this._filtersContainer.appendChild(this._filterBar.filtersElement());
this._filterBar.addEventListener(WebInspector.FilterBar.Events.FiltersToggled, this._onFiltersToggled, this);
this._filterBar.setName("timelinePanel");
},
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment