<!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>[192594] 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/192594">192594</a></dd>
<dt>Author</dt> <dd>mattbaker@apple.com</dd>
<dt>Date</dt> <dd>2015-11-18 15:47:52 -0800 (Wed, 18 Nov 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Probes sidebar panel sections should use NavigationBar
https://bugs.webkit.org/show_bug.cgi?id=151373

Reviewed by Brian Burg.

Replaces image elements with a NavigationBar instance. The &quot;Clear samples&quot;
button is disabled when no samples exist in the probe set.

* Localizations/en.lproj/localizedStrings.js:
New navigation item labels.

* UserInterface/Models/ProbeSet.js:
(WebInspector.ProbeSet.prototype._sampleCollected):
Dispatch new event WebInspector.ProbeSet.Event.SampleAdded.

* UserInterface/Views/DetailsSection.css:
(.details-section &gt; .header &gt; .options &gt; .navigation-bar):
(.details-section &gt; .header &gt; .options &gt; .navigation-bar &gt; .item):
Define consistent style for showing a NavigationBar inside the section header.

* UserInterface/Views/DetailsSection.js:
(WebInspector.DetailsSection):
Add &quot;options&quot; class name in the base class.

* UserInterface/Views/ProbeDetailsSidebarPanel.css:
(.details-section.probe-set .options &gt; :matches(.probe-remove, .probe-clear-samples, .probe-add)): Deleted.
(.details-section.probe-set .options &gt; .probe-clear-samples): Deleted.
(.details-section.probe-set .options &gt; .probe-remove): Deleted.
(.details-section.probe-set .options &gt; .probe-add): Deleted.
Remove &lt;img&gt; button styles.

* UserInterface/Views/ProbeSetDetailsSection.js:
(WebInspector.ProbeSetDetailsSection):
(WebInspector.ProbeSetDetailsSection.prototype._addProbeButtonClicked.createProbeFromEnteredExpression):
(WebInspector.ProbeSetDetailsSection.prototype._addProbeButtonClicked):
(WebInspector.ProbeSetDetailsSection.prototype._clearSamplesButtonClicked):
(WebInspector.ProbeSetDetailsSection.prototype._probeSetSamplesChanged):
Update &quot;Clear samples&quot; enabled state.
(WebInspector.ProbeSetDetailsSection.prototype._probeSetHasSamples):
Helper function to check if the probe set is empty.</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="#trunkSourceWebInspectorUIUserInterfaceModelsProbeSetjs">trunk/Source/WebInspectorUI/UserInterface/Models/ProbeSet.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDetailsSectioncss">trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSection.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDetailsSectionjs">trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSection.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsProbeDetailsSidebarPanelcss">trunk/Source/WebInspectorUI/UserInterface/Views/ProbeDetailsSidebarPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsProbeSetDetailsSectionjs">trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDetailsSection.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (192593 => 192594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-11-18 23:21:38 UTC (rev 192593)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-11-18 23:47:52 UTC (rev 192594)
</span><span class="lines">@@ -1,5 +1,48 @@
</span><span class="cx"> 2015-11-18  Matt Baker  &lt;mattbaker@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Web Inspector: Probes sidebar panel sections should use NavigationBar
+        https://bugs.webkit.org/show_bug.cgi?id=151373
+
+        Reviewed by Brian Burg.
+
+        Replaces image elements with a NavigationBar instance. The &quot;Clear samples&quot;
+        button is disabled when no samples exist in the probe set.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        New navigation item labels.
+
+        * UserInterface/Models/ProbeSet.js:
+        (WebInspector.ProbeSet.prototype._sampleCollected):
+        Dispatch new event WebInspector.ProbeSet.Event.SampleAdded.
+
+        * UserInterface/Views/DetailsSection.css:
+        (.details-section &gt; .header &gt; .options &gt; .navigation-bar):
+        (.details-section &gt; .header &gt; .options &gt; .navigation-bar &gt; .item):
+        Define consistent style for showing a NavigationBar inside the section header.
+
+        * UserInterface/Views/DetailsSection.js:
+        (WebInspector.DetailsSection):
+        Add &quot;options&quot; class name in the base class.
+
+        * UserInterface/Views/ProbeDetailsSidebarPanel.css:
+        (.details-section.probe-set .options &gt; :matches(.probe-remove, .probe-clear-samples, .probe-add)): Deleted.
+        (.details-section.probe-set .options &gt; .probe-clear-samples): Deleted.
+        (.details-section.probe-set .options &gt; .probe-remove): Deleted.
+        (.details-section.probe-set .options &gt; .probe-add): Deleted.
+        Remove &lt;img&gt; button styles.
+
+        * UserInterface/Views/ProbeSetDetailsSection.js:
+        (WebInspector.ProbeSetDetailsSection):
+        (WebInspector.ProbeSetDetailsSection.prototype._addProbeButtonClicked.createProbeFromEnteredExpression):
+        (WebInspector.ProbeSetDetailsSection.prototype._addProbeButtonClicked):
+        (WebInspector.ProbeSetDetailsSection.prototype._clearSamplesButtonClicked):
+        (WebInspector.ProbeSetDetailsSection.prototype._probeSetSamplesChanged):
+        Update &quot;Clear samples&quot; enabled state.
+        (WebInspector.ProbeSetDetailsSection.prototype._probeSetHasSamples):
+        Helper function to check if the probe set is empty.
+
+2015-11-18  Matt Baker  &lt;mattbaker@apple.com&gt;
+
</ins><span class="cx">         Web Inspector: Watch Expressions details section should use NavigationBar
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=151377
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (192593 => 192594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2015-11-18 23:21:38 UTC (rev 192593)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2015-11-18 23:47:52 UTC (rev 192594)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx"> localizedStrings[&quot;Add New Probe Expression&quot;] = &quot;Add New Probe Expression&quot;;
</span><span class="cx"> localizedStrings[&quot;Add New Watch Expression&quot;] = &quot;Add New Watch Expression&quot;;
</span><span class="cx"> localizedStrings[&quot;Add new breakpoint action after this action&quot;] = &quot;Add new breakpoint action after this action&quot;;
</span><ins>+localizedStrings[&quot;Add probe expression&quot;] = &quot;Add probe expression&quot;;
</ins><span class="cx"> localizedStrings[&quot;Add watch expression&quot;] = &quot;Add watch expression&quot;;
</span><span class="cx"> localizedStrings[&quot;Additions&quot;] = &quot;Additions&quot;;
</span><span class="cx"> localizedStrings[&quot;Align&quot;] = &quot;Align&quot;;
</span><span class="lines">@@ -116,6 +117,7 @@
</span><span class="cx"> localizedStrings[&quot;Clear Log on Navigation&quot;] = &quot;Clear Log on Navigation&quot;;
</span><span class="cx"> localizedStrings[&quot;Clear Timeline&quot;] = &quot;Clear Timeline&quot;;
</span><span class="cx"> localizedStrings[&quot;Clear log (%s or %s)&quot;] = &quot;Clear log (%s or %s)&quot;;
</span><ins>+localizedStrings[&quot;Clear samples&quot;] = &quot;Clear samples&quot;;
</ins><span class="cx"> localizedStrings[&quot;Clear watch expressions&quot;] = &quot;Clear watch expressions&quot;;
</span><span class="cx"> localizedStrings[&quot;Click Listener&quot;] = &quot;Click Listener&quot;;
</span><span class="cx"> localizedStrings[&quot;Click or press the spacebar to record.&quot;] = &quot;Click or press the spacebar to record.&quot;;
</span><span class="lines">@@ -485,6 +487,7 @@
</span><span class="cx"> localizedStrings[&quot;Reload page (%s)\nReload ignoring cache (%s)&quot;] = &quot;Reload page (%s)\nReload ignoring cache (%s)&quot;;
</span><span class="cx"> localizedStrings[&quot;Removals&quot;] = &quot;Removals&quot;;
</span><span class="cx"> localizedStrings[&quot;Remove Watch Expression&quot;] = &quot;Remove Watch Expression&quot;;
</span><ins>+localizedStrings[&quot;Remove probe&quot;] = &quot;Remove probe&quot;;
</ins><span class="cx"> localizedStrings[&quot;Remove this breakpoint action&quot;] = &quot;Remove this breakpoint action&quot;;
</span><span class="cx"> localizedStrings[&quot;Rendering Frames&quot;] = &quot;Rendering Frames&quot;;
</span><span class="cx"> localizedStrings[&quot;Repeat&quot;] = &quot;Repeat&quot;;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsProbeSetjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/ProbeSet.js (192593 => 192594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ProbeSet.js        2015-11-18 23:21:38 UTC (rev 192593)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ProbeSet.js        2015-11-18 23:47:52 UTC (rev 192594)
</span><span class="lines">@@ -141,6 +141,7 @@
</span><span class="cx"> 
</span><span class="cx">         console.assert(this.dataTable);
</span><span class="cx">         this.dataTable.addSampleForProbe(probe, sample);
</span><ins>+        this.dispatchEventToListeners(WebInspector.ProbeSet.Event.SampleAdded, {probe, sample});
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     _breakpointResolvedStateDidChange(event)
</span><span class="lines">@@ -153,5 +154,6 @@
</span><span class="cx">     ProbeAdded: &quot;probe-set-probe-added&quot;,
</span><span class="cx">     ProbeRemoved: &quot;probe-set-probe-removed&quot;,
</span><span class="cx">     ResolvedStateDidChange: &quot;probe-set-resolved-state-did-change&quot;,
</span><ins>+    SampleAdded: &quot;probe-set-sample-added&quot;,
</ins><span class="cx">     SamplesCleared: &quot;probe-set-samples-cleared&quot;,
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDetailsSectioncss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSection.css (192593 => 192594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSection.css        2015-11-18 23:21:38 UTC (rev 192593)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSection.css        2015-11-18 23:47:52 UTC (rev 192594)
</span><span class="lines">@@ -63,6 +63,18 @@
</span><span class="cx">     z-index: 200;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.details-section &gt; .header &gt; .options &gt; .navigation-bar {
+    margin-top: 1px;
+    height: 100%;
+    float: right;
+    border: none;
+}
+
+.details-section &gt; .header &gt; .options &gt; .navigation-bar &gt; .item {
+    width: 20px;
+    height: 100%;
+}
+
</ins><span class="cx"> .details-section .details-section &gt; .header {
</span><span class="cx">     top: 21px;
</span><span class="cx">     background-color: hsl(0, 0%, 100%);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDetailsSectionjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSection.js (192593 => 192594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSection.js        2015-11-18 23:21:38 UTC (rev 192593)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSection.js        2015-11-18 23:47:52 UTC (rev 192594)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> 
</span><span class="cx">         if (optionsElement instanceof HTMLElement) {
</span><span class="cx">             this._optionsElement = optionsElement;
</span><ins>+            this._optionsElement.classList.add(&quot;options&quot;);
</ins><span class="cx">             this._optionsElement.addEventListener(&quot;mousedown&quot;, this._optionsElementMouseDown.bind(this));
</span><span class="cx">             this._optionsElement.addEventListener(&quot;mouseup&quot;, this._optionsElementMouseUp.bind(this));
</span><span class="cx">             this._headerElement.appendChild(this._optionsElement);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsProbeDetailsSidebarPanelcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ProbeDetailsSidebarPanel.css (192593 => 192594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ProbeDetailsSidebarPanel.css        2015-11-18 23:21:38 UTC (rev 192593)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ProbeDetailsSidebarPanel.css        2015-11-18 23:47:52 UTC (rev 192594)
</span><span class="lines">@@ -37,28 +37,6 @@
</span><span class="cx">     display: block;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.details-section.probe-set .options &gt; :matches(.probe-remove, .probe-clear-samples, .probe-add) {
-    float: right;
-    height: 11px;
-    margin-top: 1px;
-    margin-left: 5px;
-}
-
-.details-section.probe-set .options &gt; .probe-clear-samples {
-    content: url(../Images/NavigationItemTrash.svg);
-    height: 14px;
-    margin-top: -1px;
-}
-
-.details-section.probe-set .options &gt; .probe-remove {
-    content: url(../Images/CloseLarge.svg);
-}
-
-.details-section.probe-set .options &gt; .probe-add {
-    content: url(../Images/Plus13.svg);
-    height: 13px;
-}
-
</del><span class="cx"> .details-section.probe-set .options &gt; input {
</span><span class="cx">     height: 12px;
</span><span class="cx">     width: 40px;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsProbeSetDetailsSectionjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDetailsSection.js (192593 => 192594)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDetailsSection.js        2015-11-18 23:21:38 UTC (rev 192593)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ProbeSetDetailsSection.js        2015-11-18 23:47:52 UTC (rev 192594)
</span><span class="lines">@@ -31,8 +31,6 @@
</span><span class="cx">         console.assert(probeSet instanceof WebInspector.ProbeSet, &quot;Invalid ProbeSet argument:&quot;, probeSet);
</span><span class="cx"> 
</span><span class="cx">         var optionsElement = document.createElement(&quot;div&quot;);
</span><del>-        optionsElement.classList.add(WebInspector.ProbeSetDetailsSection.SectionOptionsStyleClassName);
-
</del><span class="cx">         var dataGrid = new WebInspector.ProbeSetDataGrid(probeSet);
</span><span class="cx"> 
</span><span class="cx">         var singletonRow = new WebInspector.DetailsSectionRow;
</span><span class="lines">@@ -50,20 +48,25 @@
</span><span class="cx">         this._probeSet = probeSet;
</span><span class="cx">         this._dataGrid = dataGrid;
</span><span class="cx"> 
</span><del>-        var removeProbeButton = optionsElement.createChild(&quot;img&quot;);
-        removeProbeButton.classList.add(WebInspector.ProbeSetDetailsSection.ProbeRemoveStyleClassName);
-        removeProbeButton.classList.add(WebInspector.ProbeSetDetailsSection.ProbeButtonEnabledStyleClassName);
-        this._listeners.register(removeProbeButton, &quot;click&quot;, this._removeButtonClicked);
</del><ins>+        this._navigationBar = new WebInspector.NavigationBar;
+        this._optionsElement.appendChild(this._navigationBar.element);
</ins><span class="cx"> 
</span><del>-        var clearSamplesButton = optionsElement.createChild(&quot;img&quot;);
-        clearSamplesButton.classList.add(WebInspector.ProbeSetDetailsSection.ProbeClearSamplesStyleClassName);
-        clearSamplesButton.classList.add(WebInspector.ProbeSetDetailsSection.ProbeButtonEnabledStyleClassName);
-        this._listeners.register(clearSamplesButton, &quot;click&quot;, this._clearSamplesButtonClicked);
</del><ins>+        this._addProbeButtonItem = new WebInspector.ButtonNavigationItem(&quot;add-probe&quot;, WebInspector.UIString(&quot;Add probe expression&quot;), &quot;Images/Plus13.svg&quot;, 13, 13);
+        this._addProbeButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._addProbeButtonClicked, this);
+        this._navigationBar.addNavigationItem(this._addProbeButtonItem);
</ins><span class="cx"> 
</span><del>-        var addProbeButton = optionsElement.createChild(&quot;img&quot;);
-        addProbeButton.classList.add(WebInspector.ProbeSetDetailsSection.AddProbeValueStyleClassName);
-        this._listeners.register(addProbeButton, &quot;click&quot;, this._addProbeButtonClicked);
</del><ins>+        this._clearSamplesButtonItem = new WebInspector.ButtonNavigationItem(&quot;clear-samples&quot;, WebInspector.UIString(&quot;Clear samples&quot;), &quot;Images/NavigationItemTrash.svg&quot;, 14, 14);
+        this._clearSamplesButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._clearSamplesButtonClicked, this);
+        this._clearSamplesButtonItem.enabled = this._probeSetHasSamples();
+        this._navigationBar.addNavigationItem(this._clearSamplesButtonItem);
</ins><span class="cx"> 
</span><ins>+        this._removeProbeButtonItem = new WebInspector.ButtonNavigationItem(&quot;remove-probe&quot;, WebInspector.UIString(&quot;Remove probe&quot;), &quot;Images/CloseLarge.svg&quot;, 12, 12);
+        this._removeProbeButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._removeProbeButtonClicked, this);
+        this._navigationBar.addNavigationItem(this._removeProbeButtonItem);
+
+        this._listeners.register(this._probeSet, WebInspector.ProbeSet.Event.SampleAdded, this._probeSetSamplesChanged);
+        this._listeners.register(this._probeSet, WebInspector.ProbeSet.Event.SamplesCleared, this._probeSetSamplesChanged);
+
</ins><span class="cx">         // Update the source link when the breakpoint's resolved state changes,
</span><span class="cx">         // so that it can become a live location link when possible.
</span><span class="cx">         this._updateLinkElement();
</span><span class="lines">@@ -111,41 +114,46 @@
</span><span class="cx">         {
</span><span class="cx">             if (event.keyCode !== 13)
</span><span class="cx">                 return;
</span><del>-            var expression = event.target.value;
</del><ins>+            let expression = event.target.value;
</ins><span class="cx">             this._probeSet.createProbe(expression);
</span><span class="cx">             visiblePopover.dismiss();
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        var popover = new WebInspector.Popover;
-        var content = document.createElement(&quot;div&quot;);
</del><ins>+        let popover = new WebInspector.Popover;
+        let content = document.createElement(&quot;div&quot;);
</ins><span class="cx">         content.classList.add(WebInspector.ProbeSetDetailsSection.ProbePopoverElementStyleClassName);
</span><span class="cx">         content.createChild(&quot;div&quot;).textContent = WebInspector.UIString(&quot;Add New Probe Expression&quot;);
</span><del>-        var textBox = content.createChild(&quot;input&quot;);
</del><ins>+        let textBox = content.createChild(&quot;input&quot;);
</ins><span class="cx">         textBox.addEventListener(&quot;keypress&quot;, createProbeFromEnteredExpression.bind(this, popover));
</span><span class="cx">         textBox.addEventListener(&quot;click&quot;, function (event) { event.target.select(); });
</span><span class="cx">         textBox.type = &quot;text&quot;;
</span><span class="cx">         textBox.placeholder = WebInspector.UIString(&quot;Expression&quot;);
</span><span class="cx">         popover.content = content;
</span><del>-        var target = WebInspector.Rect.rectFromClientRect(event.target.getBoundingClientRect());
</del><ins>+        let target = WebInspector.Rect.rectFromClientRect(event.target.element.getBoundingClientRect());
</ins><span class="cx">         popover.present(target, [WebInspector.RectEdge.MAX_Y, WebInspector.RectEdge.MIN_Y, WebInspector.RectEdge.MAX_X]);
</span><span class="cx">         textBox.select();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    _removeButtonClicked(event)
</del><ins>+    _clearSamplesButtonClicked(event)
</ins><span class="cx">     {
</span><ins>+        this._probeSet.clearSamples();
+    }
+
+    _removeProbeButtonClicked(event)
+    {
</ins><span class="cx">         this._probeSet.clear();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    _clearSamplesButtonClicked(event)
</del><ins>+    _probeSetSamplesChanged(event)
</ins><span class="cx">     {
</span><del>-        this._probeSet.clearSamples();
</del><ins>+        this._clearSamplesButtonItem.enabled = this._probeSetHasSamples();
</ins><span class="cx">     }
</span><ins>+
+    _probeSetHasSamples()
+    {
+        return this._probeSet.probes.some((probe) =&gt; probe.samples.length);
+    }
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-WebInspector.ProbeSetDetailsSection.AddProbeValueStyleClassName = &quot;probe-add&quot;;
</del><span class="cx"> WebInspector.ProbeSetDetailsSection.DontFloatLinkStyleClassName = &quot;dont-float&quot;;
</span><del>-WebInspector.ProbeSetDetailsSection.ProbeButtonEnabledStyleClassName = &quot;enabled&quot;;
</del><span class="cx"> WebInspector.ProbeSetDetailsSection.ProbePopoverElementStyleClassName = &quot;probe-popover&quot;;
</span><del>-WebInspector.ProbeSetDetailsSection.ProbeClearSamplesStyleClassName = &quot;probe-clear-samples&quot;;
-WebInspector.ProbeSetDetailsSection.ProbeRemoveStyleClassName = &quot;probe-remove&quot;;
-WebInspector.ProbeSetDetailsSection.SectionOptionsStyleClassName = &quot;options&quot;;
</del></span></pre>
</div>
</div>

</body>
</html>