<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[181872] trunk/Source/WebInspectorUI</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/181872">181872</a></dd>
<dt>Author</dt> <dd>jonowells@apple.com</dd>
<dt>Date</dt> <dd>2015-03-23 15:00:19 -0700 (Mon, 23 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Debugger sidebar should have a filter button for breakpoints
https://bugs.webkit.org/show_bug.cgi?id=142779

Reviewed by Timothy Hatcher.

Add the infrastructure for activation filter buttons that can appear next to the text filters at the bottom
of any navigation sidebar panel. These filter bar buttons have defined within them a function that returns
a boolean value that indicates whether the input, typically a tree element, should be filtered or not.

This infrastructure is then used to create a filter for the debugger sidebar that, when applied, only shows
scripts that have breakpoints set on them.

* Localizations/en.lproj/localizedStrings.js: Updated.
* UserInterface/Main.html: Files added.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.showResourcesWithChildrenOnlyFilterFunction):
(WebInspector.DebuggerSidebarPanel):
(WebInspector.DebuggerSidebarPanel.prototype._addBreakpoint): Drive-by fix.
Add filter button to filter bar.

* UserInterface/Views/FilterBar.css:
(.filter-bar &gt; .navigation-bar &gt; .item):
Style filter button.

* UserInterface/Views/FilterBar.js:
(WebInspector.FilterBar):
(WebInspector.FilterBar.prototype.get filters):
(WebInspector.FilterBar.prototype.set filters):
(WebInspector.FilterBar.prototype.hasActiveFilters):
(WebInspector.FilterBar.prototype._handleFilterChanged):
(WebInspector.FilterBar.prototype._inputFieldChanged): Deleted.
Create space for filter bar buttons and set up event handlers to deal with them.

* UserInterface/Views/FilterBarButton.js: Copied from Source/WebInspectorUI/UserInterface/Views/FilterBar.css.
(WebInspector.FilterBarButton):
(WebInspector.FilterBarButton.prototype.get filterFunction):
(WebInspector.FilterBarButton.prototype.toggle):
Create class for a filter bar button that stores a filter function.

* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel):
(WebInspector.NavigationSidebarPanel.prototype.matchTreeElementAgainstFilterFunctions):
(WebInspector.NavigationSidebarPanel.prototype.applyFiltersToTreeElement):
(WebInspector.NavigationSidebarPanel.prototype._filterDidChange):
(WebInspector.NavigationSidebarPanel.prototype._updateFilter):
(WebInspector.NavigationSidebarPanel.prototype._textFilterDidChange): Deleted.
Add functionality to support button filters and process their corresponding functions correctly when filtering.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs">trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceMainhtml">trunk/Source/WebInspectorUI/UserInterface/Main.html</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDebuggerSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsFilterBarcss">trunk/Source/WebInspectorUI/UserInterface/Views/FilterBar.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsFilterBarjs">trunk/Source/WebInspectorUI/UserInterface/Views/FilterBar.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsNavigationSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsFilterBarButtonjs">trunk/Source/WebInspectorUI/UserInterface/Views/FilterBarButton.js</a></li>
<li>trunk/Source/WebInspectorUI/WebInspectorUI.esproj/</li>
<li><a href="#trunkSourceWebInspectorUIWebInspectorUIesprojProjectespressostorage">trunk/Source/WebInspectorUI/WebInspectorUI.esproj/Project.espressostorage</a></li>
<li><a href="#trunkSourceWebInspectorUIWebInspectorUIesprojuserjonowellsespressostorage">trunk/Source/WebInspectorUI/WebInspectorUI.esproj/user.jonowells.espressostorage</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (181871 => 181872)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-03-23 21:37:53 UTC (rev 181871)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-03-23 22:00:19 UTC (rev 181872)
</span><span class="lines">@@ -1,3 +1,54 @@
</span><ins>+2015-03-17  Jono Wells  &lt;jonowells@apple.com&gt;
+
+        Web Inspector: Debugger sidebar should have a filter button for breakpoints
+        https://bugs.webkit.org/show_bug.cgi?id=142779
+
+        Reviewed by Timothy Hatcher.
+
+        Add the infrastructure for activation filter buttons that can appear next to the text filters at the bottom
+        of any navigation sidebar panel. These filter bar buttons have defined within them a function that returns
+        a boolean value that indicates whether the input, typically a tree element, should be filtered or not.
+
+        This infrastructure is then used to create a filter for the debugger sidebar that, when applied, only shows
+        scripts that have breakpoints set on them.
+
+        * Localizations/en.lproj/localizedStrings.js: Updated.
+        * UserInterface/Main.html: Files added.
+
+        * UserInterface/Views/DebuggerSidebarPanel.js:
+        (WebInspector.DebuggerSidebarPanel.showResourcesWithChildrenOnlyFilterFunction):
+        (WebInspector.DebuggerSidebarPanel):
+        (WebInspector.DebuggerSidebarPanel.prototype._addBreakpoint): Drive-by fix.
+        Add filter button to filter bar.
+
+        * UserInterface/Views/FilterBar.css:
+        (.filter-bar &gt; .navigation-bar &gt; .item):
+        Style filter button.
+
+        * UserInterface/Views/FilterBar.js:
+        (WebInspector.FilterBar):
+        (WebInspector.FilterBar.prototype.get filters):
+        (WebInspector.FilterBar.prototype.set filters):
+        (WebInspector.FilterBar.prototype.hasActiveFilters):
+        (WebInspector.FilterBar.prototype._handleFilterChanged):
+        (WebInspector.FilterBar.prototype._inputFieldChanged): Deleted.
+        Create space for filter bar buttons and set up event handlers to deal with them.
+
+        * UserInterface/Views/FilterBarButton.js: Copied from Source/WebInspectorUI/UserInterface/Views/FilterBar.css.
+        (WebInspector.FilterBarButton):
+        (WebInspector.FilterBarButton.prototype.get filterFunction):
+        (WebInspector.FilterBarButton.prototype.toggle):
+        Create class for a filter bar button that stores a filter function.
+
+        * UserInterface/Views/NavigationSidebarPanel.js:
+        (WebInspector.NavigationSidebarPanel):
+        (WebInspector.NavigationSidebarPanel.prototype.matchTreeElementAgainstFilterFunctions):
+        (WebInspector.NavigationSidebarPanel.prototype.applyFiltersToTreeElement):
+        (WebInspector.NavigationSidebarPanel.prototype._filterDidChange):
+        (WebInspector.NavigationSidebarPanel.prototype._updateFilter):
+        (WebInspector.NavigationSidebarPanel.prototype._textFilterDidChange): Deleted.
+        Add functionality to support button filters and process their corresponding functions correctly when filtering.
+
</ins><span class="cx"> 2015-03-22  Matt Baker  &lt;mattbaker@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Adopt ES6 Class Syntax for all Controller Objects
</span></span></pre></div>
<a id="trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (181871 => 181872)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2015-03-23 21:37:53 UTC (rev 181871)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2015-03-23 22:00:19 UTC (rev 181872)
</span><span class="lines">@@ -423,6 +423,8 @@
</span><span class="cx"> localizedStrings[&quot;Show compositing borders&quot;] = &quot;Show compositing borders&quot;;
</span><span class="cx"> localizedStrings[&quot;Show console (%s)&quot;] = &quot;Show console (%s)&quot;;
</span><span class="cx"> localizedStrings[&quot;Show full-height console&quot;] = &quot;Show full-height console&quot;;
</span><ins>+localizedStrings[&quot;Show only resources with breakpoints.&quot;] = &quot;Show only resources with breakpoints.&quot;;
+localizedStrings[&quot;Show resources with and without breakpoints.&quot;] = &quot;Show resources with and without breakpoints.&quot;;
</ins><span class="cx"> localizedStrings[&quot;Show shadow DOM nodes&quot;] = &quot;Show shadow DOM nodes&quot;;
</span><span class="cx"> localizedStrings[&quot;Show split console&quot;] = &quot;Show split console&quot;;
</span><span class="cx"> localizedStrings[&quot;Show the %s details sidebar&quot;] = &quot;Show the %s details sidebar&quot;;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceMainhtml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Main.html (181871 => 181872)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Main.html        2015-03-23 21:37:53 UTC (rev 181871)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.html        2015-03-23 22:00:19 UTC (rev 181872)
</span><span class="lines">@@ -393,6 +393,7 @@
</span><span class="cx">     &lt;script src=&quot;Views/EventListenerSection.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/EventListenerSectionGroup.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/FilterBar.js&quot;&gt;&lt;/script&gt;
</span><ins>+    &lt;script src=&quot;Views/FilterBarButton.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;Views/FindBanner.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/FlexibleSpaceNavigationItem.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Views/FontResourceContentView.js&quot;&gt;&lt;/script&gt;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDebuggerSidebarPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js (181871 => 181872)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js        2015-03-23 21:37:53 UTC (rev 181871)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js        2015-03-23 22:00:19 UTC (rev 181872)
</span><span class="lines">@@ -53,23 +53,15 @@
</span><span class="cx"> 
</span><span class="cx">     this._navigationBar = new WebInspector.NavigationBar;
</span><span class="cx">     this.element.appendChild(this._navigationBar.element);
</span><ins>+    
+    var imageSize = WebInspector.Platform.isLegacyMacOS ? 16 : 15;
</ins><span class="cx"> 
</span><del>-    var breakpointsImage, pauseImage, resumeImage, stepOverImage, stepIntoImage, stepOutImage;
-    if (WebInspector.Platform.isLegacyMacOS) {
-        breakpointsImage = {src: &quot;Images/Legacy/Breakpoints.svg&quot;, width: 16, height: 16};
-        pauseImage = {src: &quot;Images/Legacy/Pause.svg&quot;, width: 16, height: 16};
-        resumeImage = {src: &quot;Images/Legacy/Resume.svg&quot;, width: 16, height: 16};
-        stepOverImage = {src: &quot;Images/Legacy/StepOver.svg&quot;, width: 16, height: 16};
-        stepIntoImage = {src: &quot;Images/Legacy/StepInto.svg&quot;, width: 16, height: 16};
-        stepOutImage = {src: &quot;Images/Legacy/StepOut.svg&quot;, width: 16, height: 16};
-    } else {
-        breakpointsImage = {src: &quot;Images/Breakpoints.svg&quot;, width: 15, height: 15};
-        pauseImage = {src: &quot;Images/Pause.svg&quot;, width: 15, height: 15};
-        resumeImage = {src: &quot;Images/Resume.svg&quot;, width: 15, height: 15};
-        stepOverImage = {src: &quot;Images/StepOver.svg&quot;, width: 15, height: 15};
-        stepIntoImage = {src: &quot;Images/StepInto.svg&quot;, width: 15, height: 15};
-        stepOutImage = {src: &quot;Images/StepOut.svg&quot;, width: 15, height: 15};
-    }
</del><ins>+    var breakpointsImage = {src: platformImagePath(&quot;Breakpoints.svg&quot;), width: imageSize, height: imageSize};
+    var pauseImage = {src: platformImagePath(&quot;Pause.svg&quot;), width: imageSize, height: imageSize};
+    var resumeImage = {src: platformImagePath(&quot;Resume.svg&quot;), width: imageSize, height: imageSize};
+    var stepOverImage = {src: platformImagePath(&quot;StepOver.svg&quot;), width: imageSize, height: imageSize};
+    var stepIntoImage = {src: platformImagePath(&quot;StepInto.svg&quot;), width: imageSize, height: imageSize};
+    var stepOutImage = {src: platformImagePath(&quot;StepOut.svg&quot;), width: imageSize, height: imageSize};
</ins><span class="cx"> 
</span><span class="cx">     var toolTip = WebInspector.UIString(&quot;Enable all breakpoints (%s)&quot;).format(this._toggleBreakpointsKeyboardShortcut.displayName);
</span><span class="cx">     var altToolTip = WebInspector.UIString(&quot;Disable all breakpoints (%s)&quot;).format(this._toggleBreakpointsKeyboardShortcut.displayName);
</span><span class="lines">@@ -109,7 +101,24 @@
</span><span class="cx">     this._allUncaughtExceptionsBreakpointTreeElement = new WebInspector.BreakpointTreeElement(WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint, WebInspector.DebuggerSidebarPanel.ExceptionIconStyleClassName, WebInspector.UIString(&quot;All Uncaught Exceptions&quot;));
</span><span class="cx"> 
</span><span class="cx">     this.filterBar.placeholder = WebInspector.UIString(&quot;Filter Breakpoint List&quot;);
</span><ins>+    var showResourcesWithBreakpointsOnlyFilterFunction = function(treeElement)
+    {
+        // Keep breakpoints and other elements that aren't resources.
+        if (!treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.BreakpointTreeElement)
+            return true;
</ins><span class="cx"> 
</span><ins>+        // Keep resources with breakpoints.
+        if (treeElement.hasChildren) {
+            for (var child of treeElement.children) {
+                if (child instanceof WebInspector.BreakpointTreeElement)
+                    return true;
+            }
+        }
+        return false;
+    };
+
+    this.filterBar.addFilterBarButton(&quot;debugger-show-resources-with-children-only&quot;, showResourcesWithBreakpointsOnlyFilterFunction, true, WebInspector.UIString(&quot;Show only resources with breakpoints.&quot;), WebInspector.UIString(&quot;Show resources with and without breakpoints.&quot;), platformImagePath(&quot;Breakpoints.svg&quot;), 15, 15);
+
</ins><span class="cx">     this._breakpointsContentTreeOutline = this.contentTreeOutline;
</span><span class="cx">     this._breakpointsContentTreeOutline.onselect = this._treeElementSelected.bind(this);
</span><span class="cx">     this._breakpointsContentTreeOutline.ondelete = this._breakpointTreeOutlineDeleteTreeElement.bind(this);
</span><span class="lines">@@ -282,7 +291,7 @@
</span><span class="cx">         WebInspector.debuggerManager.breakpointsEnabled = !this._debuggerBreakpointsButtonItem.activated;
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    _addBreakpoint: function(breakpoint, sourceCode)
</del><ins>+    _addBreakpoint: function(breakpoint)
</ins><span class="cx">     {
</span><span class="cx">         var sourceCode = breakpoint.sourceCodeLocation.displaySourceCode;
</span><span class="cx">         if (!sourceCode)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFilterBarcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/FilterBar.css (181871 => 181872)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FilterBar.css        2015-03-23 21:37:53 UTC (rev 181871)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FilterBar.css        2015-03-23 22:00:19 UTC (rev 181872)
</span><span class="lines">@@ -36,6 +36,10 @@
</span><span class="cx">     height: 21px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.filter-bar &gt; .navigation-bar &gt; .item {
+    padding: 0 0 3px 8px;
+}
+
</ins><span class="cx"> .filter-bar &gt; input[type=&quot;search&quot;] {
</span><span class="cx">     display: flex;
</span><span class="cx">     flex: 1;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFilterBarjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/FilterBar.js (181871 => 181872)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FilterBar.js        2015-03-23 21:37:53 UTC (rev 181871)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FilterBar.js        2015-03-23 22:00:19 UTC (rev 181872)
</span><span class="lines">@@ -30,11 +30,16 @@
</span><span class="cx">     this._element = element || document.createElement(&quot;div&quot;);
</span><span class="cx">     this._element.classList.add(WebInspector.FilterBar.StyleClassName);
</span><span class="cx"> 
</span><ins>+    this._filtersNavigationBar = new WebInspector.NavigationBar;
+    this._element.appendChild(this._filtersNavigationBar.element);
+
+    this._filterFunctionsMap = new Map;
+
</ins><span class="cx">     this._inputField = document.createElement(&quot;input&quot;);
</span><span class="cx">     this._inputField.type = &quot;search&quot;;
</span><span class="cx">     this._inputField.spellcheck = false;
</span><span class="cx">     this._inputField.incremental = true;
</span><del>-    this._inputField.addEventListener(&quot;search&quot;, this._inputFieldChanged.bind(this), false);
</del><ins>+    this._inputField.addEventListener(&quot;search&quot;, this._handleFilterChanged.bind(this), false);
</ins><span class="cx">     this._element.appendChild(this._inputField);
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -44,11 +49,12 @@
</span><span class="cx"> WebInspector.FilterBar.StyleClassName = &quot;filter-bar&quot;;
</span><span class="cx"> 
</span><span class="cx"> WebInspector.FilterBar.Event = {
</span><del>-    TextFilterDidChange: &quot;filter-bar-text-filter-did-change&quot;
</del><ins>+    FilterDidChange: &quot;filter-bar-text-filter-did-change&quot;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WebInspector.FilterBar.prototype = {
</span><span class="cx">     constructor: WebInspector.FilterBar,
</span><ins>+    __proto__: WebInspector.Object.prototype,
</ins><span class="cx"> 
</span><span class="cx">     // Public
</span><span class="cx"> 
</span><span class="lines">@@ -74,7 +80,7 @@
</span><span class="cx"> 
</span><span class="cx">     get filters()
</span><span class="cx">     {
</span><del>-        return {text: this._inputField.value};
</del><ins>+        return {text: this._inputField.value, functions: [...this._filterFunctionsMap.values()]};
</ins><span class="cx">     },
</span><span class="cx"> 
</span><span class="cx">     set filters(filters)
</span><span class="lines">@@ -84,22 +90,46 @@
</span><span class="cx">         var oldTextValue = this._inputField.value;
</span><span class="cx">         this._inputField.value = filters.text || &quot;&quot;;
</span><span class="cx">         if (oldTextValue !== this._inputField.value)
</span><del>-            this._inputFieldChanged();
</del><ins>+            this._handleFilterChanged();
</ins><span class="cx">     },
</span><span class="cx"> 
</span><ins>+    addFilterBarButton: function(identifier, filterFunction, activatedByDefault, defaultToolTip, activatedToolTip, image, imageWidth, imageHeight, suppressEmboss)
+    {
+        var filterBarButton = new WebInspector.FilterBarButton(identifier, filterFunction, activatedByDefault, defaultToolTip, activatedToolTip, image, imageWidth, imageHeight, suppressEmboss);
+        filterBarButton.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._handleFilterBarButtonClicked, this);
+        filterBarButton.addEventListener(WebInspector.FilterBarButton.Event.ActivatedStateToggled, this._handleFilterButtonToggled, this);
+        this._filtersNavigationBar.addNavigationItem(filterBarButton);
+        if (filterBarButton.activated) {
+            this._filterFunctionsMap.set(filterBarButton.identifier, filterBarButton.filterFunction);
+            this._handleFilterChanged();
+        }
+    },
+
</ins><span class="cx">     hasActiveFilters: function()
</span><span class="cx">     {
</span><del>-        if (this._inputField.value)
-            return true;
-        return false;
</del><ins>+        return !!this._inputField.value || !!this._filterFunctionsMap.size;
</ins><span class="cx">     },
</span><span class="cx"> 
</span><span class="cx">     // Private
</span><span class="cx"> 
</span><del>-    _inputFieldChanged: function(event)
</del><ins>+    _handleFilterBarButtonClicked(event)
</ins><span class="cx">     {
</span><del>-        this.dispatchEventToListeners(WebInspector.FilterBar.Event.TextFilterDidChange);
</del><ins>+        var filterBarButton = event.target;
+        filterBarButton.toggle();
+    },
+
+    _handleFilterButtonToggled: function(event)
+    {
+        var filterBarButton = event.target;
+        if (filterBarButton.activated)
+            this._filterFunctionsMap.set(filterBarButton.identifier, filterBarButton.filterFunction);
+        else
+            this._filterFunctionsMap.delete(filterBarButton.identifier);
+        this._handleFilterChanged();
+    },
+
+    _handleFilterChanged: function()
+    {
+        this.dispatchEventToListeners(WebInspector.FilterBar.Event.FilterDidChange);
</ins><span class="cx">     }
</span><span class="cx"> };
</span><del>-
-WebInspector.FilterBar.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFilterBarButtonjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/FilterBarButton.js (0 => 181872)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FilterBarButton.js                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FilterBarButton.js        2015-03-23 22:00:19 UTC (rev 181872)
</span><span class="lines">@@ -0,0 +1,60 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.FilterBarButton = function(identifier, filterFunction, activatedByDefault, defaultToolTip, activatedToolTip, image, imageWidth, imageHeight, suppressEmboss, role)
+{
+    WebInspector.ActivateButtonNavigationItem.call(this, identifier, defaultToolTip, activatedToolTip, image, imageWidth, imageHeight, suppressEmboss, role);
+
+    this._filterFunction = filterFunction;
+
+    this._activatedSetting = new WebInspector.Setting(identifier, activatedByDefault);
+
+    this.activated = !!this._activatedSetting.value;
+};
+
+WebInspector.FilterBarButton.StyleClassName = &quot;filter-bar-button&quot;;
+
+WebInspector.FilterBarButton.Event = {
+    ActivatedStateToggled: &quot;filter-bar-activated-state-toggled&quot;
+};
+
+WebInspector.FilterBarButton.prototype = {
+    constructor: WebInspector.FilterBarButton,
+    __proto__: WebInspector.ActivateButtonNavigationItem.prototype,
+
+    // Public
+
+    get filterFunction()
+    {
+        return this._filterFunction;
+    },
+
+    toggle: function()
+    {
+        this.activated = !this.activated;
+        this._activatedSetting.value = this.activated;
+        this.dispatchEventToListeners(WebInspector.FilterBarButton.Event.ActivatedStateToggled);
+    }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsNavigationSidebarPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js (181871 => 181872)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js        2015-03-23 21:37:53 UTC (rev 181871)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js        2015-03-23 22:00:19 UTC (rev 181872)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx">     this._contentTreeOutline = this.createContentTreeOutline(true);
</span><span class="cx"> 
</span><span class="cx">     this._filterBar = new WebInspector.FilterBar();
</span><del>-    this._filterBar.addEventListener(WebInspector.FilterBar.Event.TextFilterDidChange, this._textFilterDidChange, this);
</del><ins>+    this._filterBar.addEventListener(WebInspector.FilterBar.Event.FilterDidChange, this._filterDidChange, this);
</ins><span class="cx">     this.element.appendChild(this._filterBar.element);
</span><span class="cx"> 
</span><span class="cx">     this._bottomOverflowShadowElement = document.createElement(&quot;div&quot;);
</span><span class="lines">@@ -312,6 +312,15 @@
</span><span class="cx">         return true;
</span><span class="cx">     },
</span><span class="cx"> 
</span><ins>+    matchTreeElementAgainstFilterFunctions: function(treeElement)
+    {
+        for (var filterFunction of this._filterFunctions) {
+            if (filterFunction(treeElement))
+                return true;
+        }
+        return false;
+    },
+
</ins><span class="cx">     applyFiltersToTreeElement: function(treeElement)
</span><span class="cx">     {
</span><span class="cx">         if (!this._filterBar.hasActiveFilters() &amp;&amp; !this.hasCustomFilters()) {
</span><span class="lines">@@ -375,7 +384,7 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (matchTextFilter(filterableData.text) &amp;&amp; this.matchTreeElementAgainstCustomFilters(treeElement)) {
</del><ins>+        if (matchTextFilter(filterableData.text) &amp;&amp; this.matchTreeElementAgainstFilterFunctions(treeElement) &amp;&amp; this.matchTreeElementAgainstCustomFilters(treeElement)) {
</ins><span class="cx">             // Make this element visible since it matches.
</span><span class="cx">             makeVisible();
</span><span class="cx"> 
</span><span class="lines">@@ -490,7 +499,7 @@
</span><span class="cx">         this._emptyFilterResults = true;
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    _textFilterDidChange: function()
</del><ins>+    _filterDidChange: function()
</ins><span class="cx">     {
</span><span class="cx">         this._updateFilter();
</span><span class="cx">     },
</span><span class="lines">@@ -503,6 +512,7 @@
</span><span class="cx">         var filters = this._filterBar.filters;
</span><span class="cx">         this._textFilterRegex = simpleGlobStringToRegExp(filters.text, &quot;i&quot;);
</span><span class="cx">         this._filtersSetting.value = filters;
</span><ins>+        this._filterFunctions = filters.functions;
</ins><span class="cx"> 
</span><span class="cx">         // Don't populate if we don't have any active filters.
</span><span class="cx">         // We only need to populate when a filter needs to reveal.
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIWebInspectorUIesprojProjectespressostorage"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/WebInspectorUI.esproj/Project.espressostorage (0 => 181872)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/WebInspectorUI.esproj/Project.espressostorage                                (rev 0)
+++ trunk/Source/WebInspectorUI/WebInspectorUI.esproj/Project.espressostorage        2015-03-23 22:00:19 UTC (rev 181872)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+bplist00\xD2_5com.macrabbit.Espresso.Publisher.PublishServers.Order_/com.macrabbit.Espresso.Publisher.PublishServers\xA1\xA1\xD7        
+ +_ESPublishServerStateUserKey_ESPublishServerStateTypeKeyTUUID_ESPublishServerStateNameKey^ConnectionType_ESPublishServerStatePortKey_ESPublishServerStatePathKeyPTSFTP_$6A7F4EA2-F078-4DB5-AD66-AE1C5A1FE5C3_untitled server_!com.macrabbit.coreconnection.sftp+Ewy{}\x8C\xAA\xC8\xCD\xEB\xFA67&lt;cu\x99\x9B
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIWebInspectorUIesprojuserjonowellsespressostorage"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/WebInspectorUI.esproj/user.jonowells.espressostorage (0 => 181872)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/WebInspectorUI.esproj/user.jonowells.espressostorage                                (rev 0)
+++ trunk/Source/WebInspectorUI/WebInspectorUI.esproj/user.jonowells.espressostorage        2015-03-23 22:00:19 UTC (rev 181872)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+bplist00\xD2_$com.macrabbit.espresso.project.state_ESProjectWindowStateO        \xC7bplist00\xD4X$versionX$objectsY$archiverT$top\x86\xA0\xA6+U$null\xD2        
+ WNS.dataV$classO|bplist00\xD4        X$versionX$objectsY$archiverT$top\x86\xA0\xA1U$null_NSKeyedArchiver\xD0#-279?Q
+R\x80\xD2Z$classnameX$classes]NSMutableData\xA3VNSDataXNSObject\xD2        
+ O\xFDbplist00\xD4X$versionX$objectsY$archiverT$top\x86\xA0\xA3+U$null\xD2        
+ WNS.dataV$classO\xACbplist00\xD4X$versionX$objectsY$archiverT$top\x86\xA0\xA4+U$null\xD2        
+ WNS.dataV$classO\x9Dbplist00\xD4        X$versionX$objectsY$archiverT$top\x86\xA0\xA1U$null_NSKeyedArchiver\xD2
+ +[syncOptionsXsyncMode#-279?QVbkmo\x80\xD2Z$classnameX$classes]NSMutableData\xA3VNSDataXNSObject\xD2        
+ O\x94bplist00\xD4        X$versionX$objectsY$archiverT$top\x86\xA0\xA1U$null_NSKeyedArchiver\xD1
+ _browserViewMode#-279?QTf h\x80_NSKeyedArchiver\xD2_/syncTabController(MRViewControllerManagedState)_1browseTabController(MRViewControllerManagedState)\x80\x80#-27&lt;BGOV\xF6\xF8\xFD#*38\xCF\xD1\xE3\xE8NPR\x80\xD2Z$classnameX$classes]NSMutableData\xA3VNSDataXNSObject_NSKeyedArchiver\xD1_Qbookmark-state.6A7F4EA2-F078-4DB5-AD66-AE1C5A1FE5C3(MRViewControllerManagedState)\x80#-27;AFNU  .29BTW\xAB\xAD\x80\xD2        
+ Okbplist00\xD4 X$versionX$objectsY$archiverT$top\x86\xA0\xA6U$null\xD3        
+ WNS.keysZNS.objectsV$class\xA1+\x80\xA1\x80\x80]ExpandedItems\xD2
+ \xA0\x80\xD2Z$classnameX$classes^NSMutableArray\xA3WNSArrayXNSObject\xD2\NSDictionary\xA2_NSKeyedArchiver\xD1!&quot;_browserConfiguration\x80#-27&gt;DKS^egikmo}\x82\x83\x85\x8A\x95\x9E\xAD\xB1\xB9\xC2\xC7\xD4\xD7\xE9\xEC#\x80\xD2        
+ O|bplist00\xD4        X$versionX$objectsY$archiverT$top\x86\xA0\xA1U$null_NSKeyedArchiver\xD0#-279?Q
+R\x80_NSKeyedArchiver\xD9 !&quot;#$%&amp;'()((,-./0_8com.macrabbit.Espresso.WorkspaceTabs.DisclosureCollapsed_Jsection:com.macrabbit.Espresso.WorkspaceTabs(MRViewControllerManagedState)_6com.macrabbit.Espresso.FileManager.DisclosureCollapsed_4com.macrabbit.Espresso.Publisher.DisclosureCollapsed_Lsection:com.macrabbit.Espresso.WorkspaceSearch(MRViewControllerManagedState)_Fsection:com.macrabbit.Espresso.Publisher(MRViewControllerManagedState)_Hsection:com.macrabbit.Espresso.FileManager(MRViewControllerManagedState)]WorkspaceMode\sidebarWidth\x80\x80\x80\x80&quot;C\#-27&gt;DIQX\xD7\xD9\xDE\xE9\xF2 !\x90\x92\x97*=x\xC5\xFE5\x84\xCD                &amp;        3        4        6        7        8        :        &lt;        &gt;        @1        E\xD5        
+ +_ContentViewStateZProjectURL\TopLeftPointYStateType[ContentSizeO(bplist00\xD4X$versionX$objectsY$archiverT$top\x86\xA0\xA3U$null\xD3        
+ +WNS.keysZNS.objectsV$class\xA0\xA0\x80\xD2Z$classnameX$classes_NSMutableDictionary\xA3\NSDictionaryXNSObject_NSKeyedArchiver\xD1_%sidebarIdentifierToDividerPositionMap\x80#-27;AHP[bcdfkv\x95\x99\xA6\xAF\xC1\xC4\xEC\xEE__file://localhost/Users/jonowells/Source/OpenSource/Source/WebInspectorUI/WebInspectorUI.esproj/Z{204, 746}]ProjectWindowZ{916, 466}+4K
+
+!
+4
+?
+L
+V
+b \x8E \xF0 \xFB          
</ins><span class="cx">\ No newline at end of file
</span></span></pre>
</div>
</div>

</body>
</html>