<!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>[162422] 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/162422">162422</a></dd>
<dt>Author</dt> <dd>timothy@apple.com</dd>
<dt>Date</dt> <dd>2014-01-20 18:56:52 -0800 (Mon, 20 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add the recording button back to the Timelines sidebar.

https://bugs.webkit.org/show_bug.cgi?id=127314

Reviewed by Joseph Pecoraro.

* Localizations/en.lproj/localizedStrings.js: Updated.

* UserInterface/TimelineContentView.js:
(WebInspector.TimelineContentView.prototype.get navigationItems):
(WebInspector.TimelineContentView.prototype._update):
(WebInspector.TimelineContentView.prototype._updateTimes):
(WebInspector.TimelineContentView.prototype._startUpdatingCurrentTime):
(WebInspector.TimelineContentView.prototype._recordingTimesUpdated):
(WebInspector.TimelineContentView.prototype._clearTimeline):
(WebInspector.TimelineContentView.prototype._recordingReset):
Add a clear button and reset the time ruler and views when the recording resets.

* UserInterface/TimelineSidebarPanel.css:
(.sidebar &gt; .panel.timeline &gt; .status-bar):
(.sidebar &gt; .panel.timeline &gt; .status-bar &gt; .record-glyph):
(.sidebar &gt; .panel.timeline &gt; .status-bar &gt; .record-glyph.recording):
(.sidebar &gt; .panel.timeline &gt; .status-bar &gt; .record-glyph:hover):
(.sidebar &gt; .panel.timeline &gt; .status-bar &gt; .record-glyph.recording:hover):
(.sidebar &gt; .panel.timeline &gt; .status-bar &gt; .record-glyph.forced):
(.sidebar &gt; .panel.timeline &gt; .status-bar &gt; .record-glyph.recording.forced):
(.sidebar &gt; .panel.timeline &gt; .status-bar &gt; .record-status):
Add styles for the recording button and status message.

* UserInterface/TimelineSidebarPanel.js:
(WebInspector.TimelineSidebarPanel.prototype._contentBrowserCurrentContentViewDidChange):
(WebInspector.TimelineSidebarPanel.prototype._recordingStarted):
(WebInspector.TimelineSidebarPanel.prototype._recordingStopped):
(WebInspector.TimelineSidebarPanel.prototype._recordGlyphMousedOver):
(WebInspector.TimelineSidebarPanel.prototype._recordGlyphMousedOut):
(WebInspector.TimelineSidebarPanel.prototype._recordGlyphClicked):
Add support for the recording button and status message.</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="#trunkSourceWebInspectorUIUserInterfaceTimelineContentViewjs">trunk/Source/WebInspectorUI/UserInterface/TimelineContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineSidebarPanelcss">trunk/Source/WebInspectorUI/UserInterface/TimelineSidebarPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTimelineSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/TimelineSidebarPanel.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (162421 => 162422)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2014-01-21 02:56:45 UTC (rev 162421)
+++ trunk/Source/WebInspectorUI/ChangeLog        2014-01-21 02:56:52 UTC (rev 162422)
</span><span class="lines">@@ -1,5 +1,45 @@
</span><span class="cx"> 2014-01-20  Timothy Hatcher  &lt;timothy@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Add the recording button back to the Timelines sidebar.
+
+        https://bugs.webkit.org/show_bug.cgi?id=127314
+
+        Reviewed by Joseph Pecoraro.
+
+        * Localizations/en.lproj/localizedStrings.js: Updated.
+
+        * UserInterface/TimelineContentView.js:
+        (WebInspector.TimelineContentView.prototype.get navigationItems):
+        (WebInspector.TimelineContentView.prototype._update):
+        (WebInspector.TimelineContentView.prototype._updateTimes):
+        (WebInspector.TimelineContentView.prototype._startUpdatingCurrentTime):
+        (WebInspector.TimelineContentView.prototype._recordingTimesUpdated):
+        (WebInspector.TimelineContentView.prototype._clearTimeline):
+        (WebInspector.TimelineContentView.prototype._recordingReset):
+        Add a clear button and reset the time ruler and views when the recording resets.
+
+        * UserInterface/TimelineSidebarPanel.css:
+        (.sidebar &gt; .panel.timeline &gt; .status-bar):
+        (.sidebar &gt; .panel.timeline &gt; .status-bar &gt; .record-glyph):
+        (.sidebar &gt; .panel.timeline &gt; .status-bar &gt; .record-glyph.recording):
+        (.sidebar &gt; .panel.timeline &gt; .status-bar &gt; .record-glyph:hover):
+        (.sidebar &gt; .panel.timeline &gt; .status-bar &gt; .record-glyph.recording:hover):
+        (.sidebar &gt; .panel.timeline &gt; .status-bar &gt; .record-glyph.forced):
+        (.sidebar &gt; .panel.timeline &gt; .status-bar &gt; .record-glyph.recording.forced):
+        (.sidebar &gt; .panel.timeline &gt; .status-bar &gt; .record-status):
+        Add styles for the recording button and status message.
+
+        * UserInterface/TimelineSidebarPanel.js:
+        (WebInspector.TimelineSidebarPanel.prototype._contentBrowserCurrentContentViewDidChange):
+        (WebInspector.TimelineSidebarPanel.prototype._recordingStarted):
+        (WebInspector.TimelineSidebarPanel.prototype._recordingStopped):
+        (WebInspector.TimelineSidebarPanel.prototype._recordGlyphMousedOver):
+        (WebInspector.TimelineSidebarPanel.prototype._recordGlyphMousedOut):
+        (WebInspector.TimelineSidebarPanel.prototype._recordGlyphClicked):
+        Add support for the recording button and status message.
+
+2014-01-20  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
</ins><span class="cx">         Make the TimelineRecordTreeElement location subtitle live.
</span><span class="cx"> 
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=127270
</span></span></pre></div>
<a id="trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (162421 => 162422)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2014-01-21 02:56:45 UTC (rev 162421)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2014-01-21 02:56:52 UTC (rev 162422)
</span><span class="lines">@@ -70,6 +70,7 @@
</span><span class="cx"> localizedStrings[&quot;Character Data&quot;] = &quot;Character Data&quot;;
</span><span class="cx"> localizedStrings[&quot;Child Layers&quot;] = &quot;Child Layers&quot;;
</span><span class="cx"> localizedStrings[&quot;Clear Log&quot;] = &quot;Clear Log&quot;;
</span><ins>+localizedStrings[&quot;Clear Timeline&quot;] = &quot;Clear Timeline&quot;;
</ins><span class="cx"> localizedStrings[&quot;Clear log (%s or %s)&quot;] = &quot;Clear log (%s or %s)&quot;;
</span><span class="cx"> localizedStrings[&quot;Click to open a colorpicker. Shift-click to change color format.&quot;] = &quot;Click to open a colorpicker. Shift-click to change color format.&quot;;
</span><span class="cx"> localizedStrings[&quot;Close&quot;] = &quot;Close&quot;;
</span><span class="lines">@@ -289,6 +290,7 @@
</span><span class="cx"> localizedStrings[&quot;Query String&quot;] = &quot;Query String&quot;;
</span><span class="cx"> localizedStrings[&quot;Range Issue&quot;] = &quot;Range Issue&quot;;
</span><span class="cx"> localizedStrings[&quot;Reasons for compositing:&quot;] = &quot;Reasons for compositing:&quot;;
</span><ins>+localizedStrings[&quot;Recording&quot;] = &quot;Recording&quot;;
</ins><span class="cx"> localizedStrings[&quot;Recording Canvas Profile &amp;&quot;] = &quot;Recording Canvas Profile &amp;&quot;;
</span><span class="cx"> localizedStrings[&quot;Recording JavaScript Profile\u2026&quot;] = &quot;Recording JavaScript Profile\u2026&quot;;
</span><span class="cx"> localizedStrings[&quot;Recording\u2026&quot;] = &quot;Recording\u2026&quot;;
</span><span class="lines">@@ -347,6 +349,7 @@
</span><span class="cx"> localizedStrings[&quot;Source Code&quot;] = &quot;Source Code&quot;;
</span><span class="cx"> localizedStrings[&quot;Start Canvas profiling.&quot;] = &quot;Start Canvas profiling.&quot;;
</span><span class="cx"> localizedStrings[&quot;Start JavaScript profiling.&quot;] = &quot;Start JavaScript profiling.&quot;;
</span><ins>+localizedStrings[&quot;Start Recording&quot;] = &quot;Start Recording&quot;;
</ins><span class="cx"> localizedStrings[&quot;Start Time&quot;] = &quot;Start Time&quot;;
</span><span class="cx"> localizedStrings[&quot;Status&quot;] = &quot;Status&quot;;
</span><span class="cx"> localizedStrings[&quot;Step into (%s or %s)&quot;] = &quot;Step into (%s or %s)&quot;;
</span><span class="lines">@@ -354,6 +357,7 @@
</span><span class="cx"> localizedStrings[&quot;Step over (%s or %s)&quot;] = &quot;Step over (%s or %s)&quot;;
</span><span class="cx"> localizedStrings[&quot;Stop Canvas profiling.&quot;] = &quot;Stop Canvas profiling.&quot;;
</span><span class="cx"> localizedStrings[&quot;Stop JavaScript profiling.&quot;] = &quot;Stop JavaScript profiling.&quot;;
</span><ins>+localizedStrings[&quot;Stop Recording&quot;] = &quot;Stop Recording&quot;;
</ins><span class="cx"> localizedStrings[&quot;Storage&quot;] = &quot;Storage&quot;;
</span><span class="cx"> localizedStrings[&quot;Style&quot;] = &quot;Style&quot;;
</span><span class="cx"> localizedStrings[&quot;Style Attribute&quot;] = &quot;Style Attribute&quot;;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/TimelineContentView.js (162421 => 162422)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineContentView.js        2014-01-21 02:56:45 UTC (rev 162421)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineContentView.js        2014-01-21 02:56:52 UTC (rev 162422)
</span><span class="lines">@@ -44,6 +44,9 @@
</span><span class="cx">     this._viewContainer.classList.add(WebInspector.TimelineContentView.ViewContainerStyleClassName);
</span><span class="cx">     this.element.appendChild(this._viewContainer);
</span><span class="cx"> 
</span><ins>+    this._clearTimelineNavigationItem = new WebInspector.ButtonNavigationItem(&quot;clear-timeline&quot;, WebInspector.UIString(&quot;Clear Timeline&quot;), &quot;Images/NavigationItemTrash.svg&quot;, 16, 16);
+    this._clearTimelineNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._clearTimeline, this);
+
</ins><span class="cx">     this._overviewTimelineView = new WebInspector.OverviewTimelineView(recording);
</span><span class="cx"> 
</span><span class="cx">     this._discreteTimelineViewMap = new Map;
</span><span class="lines">@@ -77,7 +80,9 @@
</span><span class="cx">     this._currentTimelineViewIdentifier = null;
</span><span class="cx"> 
</span><span class="cx">     this._updating = false;
</span><ins>+    this._currentTime = NaN;
</ins><span class="cx">     this._lastUpdateTimestamp = NaN;
</span><ins>+    this._startTimeNeedsReset = true;
</ins><span class="cx"> 
</span><span class="cx">     recording.addEventListener(WebInspector.TimelineRecording.Event.Reset, this._recordingReset, this);
</span><span class="cx"> 
</span><span class="lines">@@ -128,6 +133,11 @@
</span><span class="cx">         return [this._pathComponentMap.get(this._currentTimelineViewIdentifier)];
</span><span class="cx">     },
</span><span class="cx"> 
</span><ins>+    get navigationItems()
+    {
+        return [this._clearTimelineNavigationItem];
+    },
+
</ins><span class="cx">     shown: function()
</span><span class="cx">     {
</span><span class="cx">         if (!this._currentTimelineView)
</span><span class="lines">@@ -241,6 +251,11 @@
</span><span class="cx"> 
</span><span class="cx">     _update: function(timestamp)
</span><span class="cx">     {
</span><ins>+        if (this._waitingToResetCurrentTime) {
+            requestAnimationFrame(this._updateCallback);
+            return;
+        }
+
</ins><span class="cx">         var startTime = this._recording.startTime;
</span><span class="cx">         var currentTime = this._currentTime || startTime;
</span><span class="cx">         var endTime = this._recording.endTime;
</span><span class="lines">@@ -248,6 +263,21 @@
</span><span class="cx"> 
</span><span class="cx">         currentTime += timespanSinceLastUpdate;
</span><span class="cx"> 
</span><ins>+        this._updateTimes(startTime, currentTime, endTime);
+
+        // Only stop updating if the current time is greater than the end time.
+        if (!this._updating &amp;&amp; currentTime &gt;= endTime) {
+            this._lastUpdateTimestamp = NaN;
+            return;
+        }
+
+        this._lastUpdateTimestamp = timestamp;
+
+        requestAnimationFrame(this._updateCallback);
+    },
+
+    _updateTimes: function(startTime, currentTime, endTime)
+    {
</ins><span class="cx">         if (this._startTimeNeedsReset &amp;&amp; !isNaN(startTime)) {
</span><span class="cx">             var selectionOffset = this._timelineOverview.selectionStartTime - this._timelineOverview.startTime;
</span><span class="cx"> 
</span><span class="lines">@@ -270,16 +300,6 @@
</span><span class="cx">         // Force a layout now since we are already in an animation frame and don't need to delay it until the next.
</span><span class="cx">         this._timelineOverview.updateLayoutIfNeeded();
</span><span class="cx">         this._currentTimelineView.updateLayoutIfNeeded();
</span><del>-
-        // Only stop updating if the current time is greater than the end time.
-        if (!this._updating &amp;&amp; currentTime &gt;= endTime) {
-            this._lastUpdateTimestamp = NaN;
-            return;
-        }
-
-        this._lastUpdateTimestamp = timestamp;
-
-        requestAnimationFrame(this._updateCallback);
</del><span class="cx">     },
</span><span class="cx"> 
</span><span class="cx">     _startUpdatingCurrentTime: function()
</span><span class="lines">@@ -288,6 +308,13 @@
</span><span class="cx">         if (this._updating)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><ins>+        if (!isNaN(this._currentTime)) {
+            // We have a current time already, so we likely need to jump into the future to a better current time.
+            // This happens when you stop and later restart recording.
+            this._waitingToResetCurrentTime = true;
+            this._recording.addEventListener(WebInspector.TimelineRecording.Event.TimesUpdated, this._recordingTimesUpdated, this);
+        }
+
</ins><span class="cx">         this._updating = true;
</span><span class="cx"> 
</span><span class="cx">         if (!this._updateCallback)
</span><span class="lines">@@ -312,11 +339,48 @@
</span><span class="cx">         this._stopUpdatingCurrentTime();
</span><span class="cx">     },
</span><span class="cx"> 
</span><ins>+    _recordingTimesUpdated: function(event)
+    {
+        if (!this._waitingToResetCurrentTime)
+            return;
+
+        // Make the current time be the start time of the last added record. This is the best way
+        // currently to jump to the right period of time after recording starts.
+        // FIXME: If no activity is happening we can sit for a while until a record is added.
+        // We might want to have the backend send a &quot;start&quot; record to get current time moving.
+
+        for (var timeline of this._recording.timelines.values()) {
+            var lastRecord = timeline.records.lastValue;
+            if (!lastRecord)
+                continue;
+            this._currentTime = Math.max(this._currentTime, lastRecord.startTime);
+        }
+
+        this._recording.removeEventListener(WebInspector.TimelineRecording.Event.TimesUpdated, this._recordingTimesUpdated, this);
+        delete this._waitingToResetCurrentTime;
+    },
+
+    _clearTimeline: function(event)
+    {
+        this._recording.reset();
+    },
+
</ins><span class="cx">     _recordingReset: function(event)
</span><span class="cx">     {
</span><del>-        this._startTimeNeedsReset = true;
</del><span class="cx">         this._currentTime = NaN;
</span><span class="cx"> 
</span><ins>+        if (!this._updating) {
+            // Force the time ruler and views to reset to 0.
+            this._startTimeNeedsReset = true;
+            this._updateTimes(0, 0, 0);
+        }
+
+        this._lastUpdateTimestamp = NaN;
+        this._startTimeNeedsReset = true;
+
+        this._recording.removeEventListener(WebInspector.TimelineRecording.Event.TimesUpdated, this._recordingTimesUpdated, this);
+        delete this._waitingToResetCurrentTime;
+
</ins><span class="cx">         this._overviewTimelineView.reset();
</span><span class="cx">         for (var timelineView of this._discreteTimelineViewMap.values())
</span><span class="cx">             timelineView.reset();
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineSidebarPanelcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/TimelineSidebarPanel.css (162421 => 162422)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineSidebarPanel.css        2014-01-21 02:56:45 UTC (rev 162421)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineSidebarPanel.css        2014-01-21 02:56:52 UTC (rev 162422)
</span><span class="lines">@@ -23,13 +23,72 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-.sidebar &gt; .panel.timeline &gt; .navigation-bar {
</del><ins>+.sidebar &gt; .panel.timeline &gt; .status-bar {
</ins><span class="cx">     position: absolute;
</span><span class="cx">     top: 0;
</span><span class="cx">     left: 0;
</span><span class="cx">     right: 0;
</span><ins>+    height: 22px;
+    border-bottom: 1px solid rgb(179, 179, 179);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.sidebar &gt; .panel.timeline &gt; .status-bar &gt; .record-glyph {
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 21px;
+    height: 21px;
+    padding: 0;
+    border: none;
+    outline: none;
+    color: transparent;
+    overflow: hidden;
+
+    -webkit-appearance: none;
+
+    background-color: transparent;
+    background-image: -webkit-image-set(url(Images/RecordingStopped.png) 1x, url(Images/RecordingStopped@2x.png) 2x);
+    background-repeat: no-repeat;
+    background-size: 21px 21px;
+}
+
+.sidebar &gt; .panel.timeline &gt; .status-bar &gt; .record-glyph.recording {
+    background-image: -webkit-image-set(url(Images/Recording.png) 1x, url(Images/Recording@2x.png) 2x);
+}
+
+.sidebar &gt; .panel.timeline &gt; .status-bar &gt; .record-glyph:hover {
+    background-image: -webkit-image-set(url(Images/RecordingHovered.png) 1x, url(Images/RecordingHovered@2x.png) 2x);
+}
+
+.sidebar &gt; .panel.timeline &gt; .status-bar &gt; .record-glyph.recording:hover {
+    background-image: -webkit-image-set(url(Images/RecordingStopped.png) 1x, url(Images/RecordingStopped@2x.png) 2x);
+}
+
+.sidebar &gt; .panel.timeline &gt; .status-bar &gt; .record-glyph.forced {
+    background-image: -webkit-image-set(url(Images/RecordingStopped.png) 1x, url(Images/RecordingStopped@2x.png) 2x) !important;
+}
+
+.sidebar &gt; .panel.timeline &gt; .status-bar &gt; .record-glyph.recording.forced {
+    background-image: -webkit-image-set(url(Images/Recording.png) 1x, url(Images/Recording@2x.png) 2x) !important;
+}
+
+.sidebar &gt; .panel.timeline &gt; .status-bar &gt; .record-status {
+    position: absolute;
+    top: 0;
+    right: 21px;
+    left: 21px;
+
+    text-align: center;
+
+    line-height: 20px;
+    font-size: 11px;
+    font-family: &quot;Lucida Grande&quot;, sans-serif;
+    font-weight: bold;
+
+    color: rgb(76, 76, 76);
+    text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
+}
+
</ins><span class="cx"> .sidebar &gt; .panel.timeline &gt; .title-bar {
</span><span class="cx">     position: absolute;
</span><span class="cx">     left: 0;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTimelineSidebarPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/TimelineSidebarPanel.js (162421 => 162422)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/TimelineSidebarPanel.js        2014-01-21 02:56:45 UTC (rev 162421)
+++ trunk/Source/WebInspectorUI/UserInterface/TimelineSidebarPanel.js        2014-01-21 02:56:52 UTC (rev 162422)
</span><span class="lines">@@ -49,9 +49,21 @@
</span><span class="cx">     timelinesTitleBarElement.classList.add(WebInspector.TimelineSidebarPanel.TimelinesTitleBarStyleClass);
</span><span class="cx">     this.element.insertBefore(timelinesTitleBarElement, this.element.firstChild);
</span><span class="cx"> 
</span><del>-    this._navigationBar = new WebInspector.NavigationBar;
-    this.element.insertBefore(this._navigationBar.element, this.element.firstChild);
</del><ins>+    var statusBarElement = document.createElement(&quot;div&quot;);
+    statusBarElement.classList.add(WebInspector.TimelineSidebarPanel.StatusBarStyleClass);
+    this.element.insertBefore(statusBarElement, this.element.firstChild);
</ins><span class="cx"> 
</span><ins>+    this._recordGlyphElement = document.createElement(&quot;div&quot;);
+    this._recordGlyphElement.className = WebInspector.TimelineSidebarPanel.RecordGlyphStyleClass;
+    this._recordGlyphElement.addEventListener(&quot;mouseover&quot;, this._recordGlyphMousedOver.bind(this));
+    this._recordGlyphElement.addEventListener(&quot;mouseout&quot;, this._recordGlyphMousedOut.bind(this));
+    this._recordGlyphElement.addEventListener(&quot;click&quot;, this._recordGlyphClicked.bind(this));
+    statusBarElement.appendChild(this._recordGlyphElement);
+
+    this._recordStatusElement = document.createElement(&quot;div&quot;);
+    this._recordStatusElement.className = WebInspector.TimelineSidebarPanel.RecordStatusStyleClass;
+    statusBarElement.appendChild(this._recordStatusElement);
+
</ins><span class="cx">     function createTimelineTreeElement(label, iconClass, identifier)
</span><span class="cx">     {
</span><span class="cx">         var treeElement = new WebInspector.GeneralTreeElement([iconClass, WebInspector.TimelineSidebarPanel.LargeIconStyleClass], label, null, identifier);
</span><span class="lines">@@ -78,6 +90,8 @@
</span><span class="cx">     this.contentElement.insertBefore(this._stripeBackgroundElement, this.contentElement.firstChild);
</span><span class="cx"> 
</span><span class="cx">     WebInspector.contentBrowser.addEventListener(WebInspector.ContentBrowser.Event.CurrentContentViewDidChange, this._contentBrowserCurrentContentViewDidChange, this);
</span><ins>+    WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.RecordingStarted, this._recordingStarted, this);
+    WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.RecordingStopped, this._recordingStopped, this);
</ins><span class="cx"> 
</span><span class="cx">     function delayedWork()
</span><span class="cx">     {
</span><span class="lines">@@ -89,6 +103,11 @@
</span><span class="cx">     setTimeout(delayedWork.bind(this), 0);
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+WebInspector.TimelineSidebarPanel.StatusBarStyleClass = &quot;status-bar&quot;;
+WebInspector.TimelineSidebarPanel.RecordGlyphStyleClass = &quot;record-glyph&quot;;
+WebInspector.TimelineSidebarPanel.RecordGlyphRecordingStyleClass = &quot;recording&quot;;
+WebInspector.TimelineSidebarPanel.RecordGlyphRecordingForcedStyleClass = &quot;forced&quot;;
+WebInspector.TimelineSidebarPanel.RecordStatusStyleClass = &quot;record-status&quot;;
</ins><span class="cx"> WebInspector.TimelineSidebarPanel.TitleBarStyleClass = &quot;title-bar&quot;;
</span><span class="cx"> WebInspector.TimelineSidebarPanel.TimelinesTitleBarStyleClass = &quot;timelines&quot;;
</span><span class="cx"> WebInspector.TimelineSidebarPanel.TimelineEventsTitleBarStyleClass = &quot;timeline-events&quot;;
</span><span class="lines">@@ -288,5 +307,48 @@
</span><span class="cx">             this.element.classList.add(WebInspector.TimelineSidebarPanel.TimelineContentViewShowingStyleClass);
</span><span class="cx">         else
</span><span class="cx">             this.element.classList.remove(WebInspector.TimelineSidebarPanel.TimelineContentViewShowingStyleClass);
</span><ins>+    },
+
+    _recordingStarted: function(event)
+    {
+        this._recordStatusElement.textContent = WebInspector.UIString(&quot;Recording&quot;);
+        this._recordGlyphElement.classList.add(WebInspector.TimelineSidebarPanel.RecordGlyphRecordingStyleClass);
+    },
+
+    _recordingStopped: function(event)
+    {
+        this._recordStatusElement.textContent = &quot;&quot;;
+        this._recordGlyphElement.classList.remove(WebInspector.TimelineSidebarPanel.RecordGlyphRecordingStyleClass);
+    },
+
+    _recordGlyphMousedOver: function(event)
+    {
+        this._recordGlyphElement.classList.remove(WebInspector.TimelineSidebarPanel.RecordGlyphRecordingForcedStyleClass);
+
+        if (WebInspector.timelineManager.recordingEnabled)
+            this._recordStatusElement.textContent = WebInspector.UIString(&quot;Stop Recording&quot;);
+        else
+            this._recordStatusElement.textContent = WebInspector.UIString(&quot;Start Recording&quot;);
+    },
+
+    _recordGlyphMousedOut: function(event)
+    {
+        this._recordGlyphElement.classList.remove(WebInspector.TimelineSidebarPanel.RecordGlyphRecordingForcedStyleClass);
+
+        if (WebInspector.timelineManager.recordingEnabled)
+            this._recordStatusElement.textContent = WebInspector.UIString(&quot;Recording&quot;);
+        else
+            this._recordStatusElement.textContent = &quot;&quot;;
+    },
+
+    _recordGlyphClicked: function(event)
+    {
+        // Add forced class to prevent the glyph from showing a confusing status after click.
+        this._recordGlyphElement.classList.add(WebInspector.TimelineSidebarPanel.RecordGlyphRecordingForcedStyleClass);
+
+        if (WebInspector.timelineManager.recordingEnabled)
+            WebInspector.timelineManager.stopRecording();
+        else
+            WebInspector.timelineManager.startRecording();
</ins><span class="cx">     }
</span><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>