<!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>[194936] 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/194936">194936</a></dd>
<dt>Author</dt> <dd>mattbaker@apple.com</dd>
<dt>Date</dt> <dd>2016-01-12 17:14:14 -0800 (Tue, 12 Jan 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Inspector: Timeline recording controls should use NavigationBar
https://bugs.webkit.org/show_bug.cgi?id=152997
Reviewed by Brian Burg.
NavigtaionBar should always be preferred over manually editing the DOM.
Reusing existing button types for the record button and status element lets us
eliminate a bunch of CSS, and will make future changes to the Timelines UI
(such as adding addition recording controls), easier to implement.
* Localizations/en.lproj/localizedStrings.js:
New tooltip strings.
* UserInterface/Views/TimelineSidebarPanel.css:
(.sidebar > .panel.navigation.timeline > .navigation-bar > .item.record-start-stop):
(.sidebar > .panel.navigation.timeline > .navigation-bar > .item.record-start-stop:hover):
(.sidebar > .panel.navigation.timeline > .navigation-bar > .item.record-start-stop:active):
Replaced similar styles used for the record glyph.
(.sidebar > .panel.navigation.timeline > .navigation-bar > .item.record-start-stop *):
Prevent multiple mouseover/mouseout events while hovering the navigation item.
(.sidebar > .panel.navigation.timeline > .navigation-bar > .item.flexible-space):
Replaced similar styles used for the record status element.
(.sidebar > .panel.navigation.timeline > .status-bar): Deleted.
(body.window-inactive .sidebar > .panel.navigation.timeline > .status-bar): Deleted.
(.sidebar > .panel.navigation.timeline > .status-bar > .record-glyph): Deleted.
(.sidebar > .panel.navigation.timeline > .status-bar > .record-glyph:hover): Deleted.
(.sidebar > .panel.navigation.timeline > .status-bar > .record-glyph:active): Deleted.
(.sidebar > .panel.navigation.timeline > .status-bar > .record-glyph.recording): Deleted.
(.sidebar > .panel.navigation.timeline > .status-bar > .record-status): Deleted.
(.panel.timeline .navigation-bar.timelines-view): Deleted.
No longer used.
* UserInterface/Views/TimelineSidebarPanel.js:
Removed unused CSS static variables.
(WebInspector.TimelineSidebarPanel):
Create navigation bar, remove status bar DOM elements. Create keyboard shortcut
before the record button, so the shortcut's display name can be used in tooltips.
(WebInspector.TimelineSidebarPanel.prototype._capturingStartedOrStopped):
Update record button state and flexible space (status) text.
(WebInspector.TimelineSidebarPanel.prototype._recordButtonClicked):
Toggle recording state, and update record button state and flexible space (status) text.
(WebInspector.TimelineSidebarPanel.prototype._recordButtonMousedOver):
(WebInspector.TimelineSidebarPanel.prototype._recordButtonMousedOut):
Update flexible space (status) text.
(WebInspector.TimelineSidebarPanel.prototype._updateRecordButton):
(WebInspector.TimelineSidebarPanel.prototype._updateReplayInterfaceVisibility):
(WebInspector.TimelineSidebarPanel.prototype._toggleRecording): Deleted.
(WebInspector.TimelineSidebarPanel.prototype._capturingStarted): Deleted.
(WebInspector.TimelineSidebarPanel.prototype._capturingStopped): Deleted.
(WebInspector.TimelineSidebarPanel.prototype._recordGlyphMousedOver): Deleted.
(WebInspector.TimelineSidebarPanel.prototype._recordGlyphMousedOut): Deleted.
(WebInspector.TimelineSidebarPanel.prototype._recordGlyphClicked): Deleted.
No longer used.</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="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineSidebarPanelcss">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/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 (194935 => 194936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2016-01-13 01:05:20 UTC (rev 194935)
+++ trunk/Source/WebInspectorUI/ChangeLog        2016-01-13 01:14:14 UTC (rev 194936)
</span><span class="lines">@@ -1,5 +1,61 @@
</span><span class="cx"> 2016-01-12 Matt Baker <mattbaker@apple.com>
</span><span class="cx">
</span><ins>+ Web Inspector: Timeline recording controls should use NavigationBar
+ https://bugs.webkit.org/show_bug.cgi?id=152997
+
+ Reviewed by Brian Burg.
+
+ NavigtaionBar should always be preferred over manually editing the DOM.
+ Reusing existing button types for the record button and status element lets us
+ eliminate a bunch of CSS, and will make future changes to the Timelines UI
+ (such as adding addition recording controls), easier to implement.
+
+ * Localizations/en.lproj/localizedStrings.js:
+ New tooltip strings.
+
+ * UserInterface/Views/TimelineSidebarPanel.css:
+ (.sidebar > .panel.navigation.timeline > .navigation-bar > .item.record-start-stop):
+ (.sidebar > .panel.navigation.timeline > .navigation-bar > .item.record-start-stop:hover):
+ (.sidebar > .panel.navigation.timeline > .navigation-bar > .item.record-start-stop:active):
+ Replaced similar styles used for the record glyph.
+ (.sidebar > .panel.navigation.timeline > .navigation-bar > .item.record-start-stop *):
+ Prevent multiple mouseover/mouseout events while hovering the navigation item.
+ (.sidebar > .panel.navigation.timeline > .navigation-bar > .item.flexible-space):
+ Replaced similar styles used for the record status element.
+ (.sidebar > .panel.navigation.timeline > .status-bar): Deleted.
+ (body.window-inactive .sidebar > .panel.navigation.timeline > .status-bar): Deleted.
+ (.sidebar > .panel.navigation.timeline > .status-bar > .record-glyph): Deleted.
+ (.sidebar > .panel.navigation.timeline > .status-bar > .record-glyph:hover): Deleted.
+ (.sidebar > .panel.navigation.timeline > .status-bar > .record-glyph:active): Deleted.
+ (.sidebar > .panel.navigation.timeline > .status-bar > .record-glyph.recording): Deleted.
+ (.sidebar > .panel.navigation.timeline > .status-bar > .record-status): Deleted.
+ (.panel.timeline .navigation-bar.timelines-view): Deleted.
+ No longer used.
+
+ * UserInterface/Views/TimelineSidebarPanel.js:
+ Removed unused CSS static variables.
+ (WebInspector.TimelineSidebarPanel):
+ Create navigation bar, remove status bar DOM elements. Create keyboard shortcut
+ before the record button, so the shortcut's display name can be used in tooltips.
+ (WebInspector.TimelineSidebarPanel.prototype._capturingStartedOrStopped):
+ Update record button state and flexible space (status) text.
+ (WebInspector.TimelineSidebarPanel.prototype._recordButtonClicked):
+ Toggle recording state, and update record button state and flexible space (status) text.
+ (WebInspector.TimelineSidebarPanel.prototype._recordButtonMousedOver):
+ (WebInspector.TimelineSidebarPanel.prototype._recordButtonMousedOut):
+ Update flexible space (status) text.
+ (WebInspector.TimelineSidebarPanel.prototype._updateRecordButton):
+ (WebInspector.TimelineSidebarPanel.prototype._updateReplayInterfaceVisibility):
+ (WebInspector.TimelineSidebarPanel.prototype._toggleRecording): Deleted.
+ (WebInspector.TimelineSidebarPanel.prototype._capturingStarted): Deleted.
+ (WebInspector.TimelineSidebarPanel.prototype._capturingStopped): Deleted.
+ (WebInspector.TimelineSidebarPanel.prototype._recordGlyphMousedOver): Deleted.
+ (WebInspector.TimelineSidebarPanel.prototype._recordGlyphMousedOut): Deleted.
+ (WebInspector.TimelineSidebarPanel.prototype._recordGlyphClicked): Deleted.
+ No longer used.
+
+2016-01-12 Matt Baker <mattbaker@apple.com>
+
</ins><span class="cx"> Web Inspector: Move helper methods for getting icons/text to TimelineTabContentView
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=152996
</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 (194935 => 194936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2016-01-13 01:05:20 UTC (rev 194935)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2016-01-13 01:14:14 UTC (rev 194936)
</span><span class="lines">@@ -65,8 +65,8 @@
</span><span class="cx"> localizedStrings["All Resources"] = "All Resources";
</span><span class="cx"> localizedStrings["All Storage"] = "All Storage";
</span><span class="cx"> localizedStrings["All Uncaught Exceptions"] = "All Uncaught Exceptions";
</span><ins>+localizedStrings["An error occurred trying to load the resource."] = "An error occurred trying to load the resource.";
</ins><span class="cx"> localizedStrings["An error occurred trying to read the %s table."] = "An error occurred trying to read the %s table.";
</span><del>-localizedStrings["An error occurred trying to load the resource."] = "An error occurred trying to load the resource.";
</del><span class="cx"> localizedStrings["An unexpected error %s occurred."] = "An unexpected error %s occurred.";
</span><span class="cx"> localizedStrings["An unexpected error occurred."] = "An unexpected error occurred.";
</span><span class="cx"> localizedStrings["Angle"] = "Angle";
</span><span class="lines">@@ -124,8 +124,6 @@
</span><span class="cx"> localizedStrings["Clear samples"] = "Clear samples";
</span><span class="cx"> localizedStrings["Clear watch expressions"] = "Clear watch expressions";
</span><span class="cx"> localizedStrings["Click Listener"] = "Click Listener";
</span><del>-localizedStrings["Click or press the spacebar to record."] = "Click or press the spacebar to record.";
-localizedStrings["Click or press the spacebar to stop recording."] = "Click or press the spacebar to stop recording.";
</del><span class="cx"> localizedStrings["Click to add a new rule."] = "Click to add a new rule.";
</span><span class="cx"> localizedStrings["Click to clear modified properties"] = "Click to clear modified properties";
</span><span class="cx"> localizedStrings["Click to close this tab"] = "Click to close this tab";
</span><span class="lines">@@ -602,6 +600,7 @@
</span><span class="cx"> localizedStrings["Start Playback"] = "Start Playback";
</span><span class="cx"> localizedStrings["Start Recording"] = "Start Recording";
</span><span class="cx"> localizedStrings["Start Time"] = "Start Time";
</span><ins>+localizedStrings["Start recording (%s)\nCreate new recording (%s)"] = "Start recording (%s)\nCreate new recording (%s)";
</ins><span class="cx"> localizedStrings["State"] = "State";
</span><span class="cx"> localizedStrings["Status"] = "Status";
</span><span class="cx"> localizedStrings["Step"] = "Step";
</span><span class="lines">@@ -609,6 +608,7 @@
</span><span class="cx"> localizedStrings["Step out (%s or %s)"] = "Step out (%s or %s)";
</span><span class="cx"> localizedStrings["Step over (%s or %s)"] = "Step over (%s or %s)";
</span><span class="cx"> localizedStrings["Stop Recording"] = "Stop Recording";
</span><ins>+localizedStrings["Stop recording (%s)"] = "Stop recording (%s)";
</ins><span class="cx"> localizedStrings["Storage"] = "Storage";
</span><span class="cx"> localizedStrings["Style"] = "Style";
</span><span class="cx"> localizedStrings["Style Attribute"] = "Style Attribute";
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineSidebarPanelcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.css (194935 => 194936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.css        2016-01-13 01:05:20 UTC (rev 194935)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.css        2016-01-13 01:14:14 UTC (rev 194936)
</span><span class="lines">@@ -23,65 +23,26 @@
</span><span class="cx"> * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-.sidebar > .panel.navigation.timeline > .status-bar {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- height: 29px;
- border-bottom: 1px solid hsl(0, 0%, 70%);
-}
-
-body.window-inactive .sidebar > .panel.navigation.timeline > .status-bar {
- border-bottom-color: hsl(0, 0%, 85%);
-}
-
-.sidebar > .panel.navigation.timeline > .status-bar > .record-glyph {
- position: absolute;
- top: 3px;
- left: 5px;
- width: 21px;
- height: 21px;
- padding: 0;
- border: none;
- outline: none;
- color: transparent;
- overflow: hidden;
-
- -webkit-appearance: none;
-
- background-color: transparent;
- background-repeat: no-repeat;
- background-image: url(../Images/Record.svg);
- background-size: 13px 13px;
- background-position: center;
-}
-
-.sidebar > .panel.navigation.timeline > .status-bar > .record-glyph {
</del><ins>+.sidebar > .panel.navigation.timeline > .navigation-bar > .item.record-start-stop {
</ins><span class="cx"> /* Workaround for background image clipping issue on non-retina machines. See http://webkit.org/b/147346. */
</span><span class="cx"> filter: brightness(100%);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-.sidebar > .panel.navigation.timeline > .status-bar > .record-glyph:hover {
</del><ins>+.sidebar > .panel.navigation.timeline > .navigation-bar > .item.record-start-stop:hover {
</ins><span class="cx"> filter: brightness(95%);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-.sidebar > .panel.navigation.timeline > .status-bar > .record-glyph:active {
</del><ins>+.sidebar > .panel.navigation.timeline > .navigation-bar > .item.record-start-stop:active {
</ins><span class="cx"> filter: brightness(80%);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-.sidebar > .panel.navigation.timeline > .status-bar > .record-glyph.recording {
- background-image: url(../Images/Stop.svg);
</del><ins>+.sidebar > .panel.navigation.timeline > .navigation-bar > .item.record-start-stop * {
+ pointer-events: none;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-.sidebar > .panel.navigation.timeline > .status-bar > .record-status {
- position: absolute;
- top: 3px;
- right: 21px;
- left: 27px;
</del><ins>+.sidebar > .panel.navigation.timeline > .navigation-bar > .item.flexible-space {
+ justify-content: center;
</ins><span class="cx">
</span><del>- text-align: center;
-
</del><span class="cx"> line-height: 20px;
</span><span class="cx"> font-weight: bold;
</span><span class="cx">
</span><span class="lines">@@ -89,10 +50,6 @@
</span><span class="cx"> text-shadow: hsla(0, 0%, 100%, 0.5) 0 1px 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-.panel.timeline .navigation-bar.timelines-view {
- justify-content: flex-end;
-}
-
</del><span class="cx"> .sidebar > .panel.navigation.timeline > .title-bar {
</span><span class="cx"> position: absolute;
</span><span class="cx"> left: 0;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineSidebarPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js (194935 => 194936)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js        2016-01-13 01:05:20 UTC (rev 194935)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js        2016-01-13 01:14:14 UTC (rev 194936)
</span><span class="lines">@@ -115,30 +115,37 @@
</span><span class="cx"> this._timelinesContentContainerElement.appendChild(this._frameSelectionChartSection.element);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- var statusBarElement = this._statusBarElement = document.createElement("div");
- statusBarElement.classList.add(WebInspector.TimelineSidebarPanel.StatusBarStyleClass);
- this.element.insertBefore(statusBarElement, this.element.firstChild);
</del><ins>+ this._toggleRecordingShortcut = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.Space, this._toggleRecordingOnSpacebar.bind(this));
+ this._toggleRecordingShortcut.implicitlyPreventsDefault = false;
+ this._toggleRecordingShortcut.disabled = true;
</ins><span class="cx">
</span><del>- this._recordGlyphElement = document.createElement("div");
- this._recordGlyphElement.className = WebInspector.TimelineSidebarPanel.RecordGlyphStyleClass;
- this._recordGlyphElement.title = WebInspector.UIString("Click or press the spacebar to record.")
- this._recordGlyphElement.addEventListener("mouseover", this._recordGlyphMousedOver.bind(this));
- this._recordGlyphElement.addEventListener("mouseout", this._recordGlyphMousedOut.bind(this));
- this._recordGlyphElement.addEventListener("click", this._recordGlyphClicked.bind(this));
- statusBarElement.appendChild(this._recordGlyphElement);
</del><ins>+ this._toggleNewRecordingShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Shift, WebInspector.KeyboardShortcut.Key.Space, this._toggleNewRecordingOnSpacebar.bind(this));
+ this._toggleNewRecordingShortcut.implicitlyPreventsDefault = false;
+ this._toggleNewRecordingShortcut.disabled = true;
</ins><span class="cx">
</span><del>- this._recordStatusElement = document.createElement("div");
- this._recordStatusElement.className = WebInspector.TimelineSidebarPanel.RecordStatusStyleClass;
- statusBarElement.appendChild(this._recordStatusElement);
</del><ins>+ this._recordingNavigationBar = new WebInspector.NavigationBar;
+ this.element.insertBefore(this._recordingNavigationBar.element, this.element.firstChild);
</ins><span class="cx">
</span><ins>+ let toolTip = WebInspector.UIString("Start recording (%s)\nCreate new recording (%s)").format(this._toggleRecordingShortcut.displayName, this._toggleNewRecordingShortcut.displayName);
+ let altToolTip = WebInspector.UIString("Stop recording (%s)").format(this._toggleRecordingShortcut.displayName);
+
+ this._recordButton = new WebInspector.ToggleButtonNavigationItem("record-start-stop", toolTip, altToolTip, "Images/Record.svg", "Images/Stop.svg", 13, 13);
+ this._recordButton.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._recordButtonClicked, this);
+ this._recordButton.element.addEventListener("mouseover", this._recordButtonMousedOver.bind(this));
+ this._recordButton.element.addEventListener("mouseout", this._recordButtonMousedOut.bind(this));
+ this._recordingNavigationBar.addNavigationItem(this._recordButton);
+
+ this._recordingStatusItem = new WebInspector.FlexibleSpaceNavigationItem;
+ this._recordingNavigationBar.addNavigationItem(this._recordingStatusItem);
+
</ins><span class="cx"> WebInspector.showReplayInterfaceSetting.addEventListener(WebInspector.Setting.Event.Changed, this._updateReplayInterfaceVisibility, this);
</span><span class="cx">
</span><span class="cx"> // We always create a replay navigation bar; its visibility is controlled by WebInspector.showReplayInterfaceSetting.
</span><span class="cx"> this._replayNavigationBar = new WebInspector.NavigationBar;
</span><span class="cx"> this.element.appendChild(this._replayNavigationBar.element);
</span><span class="cx">
</span><del>- var toolTip = WebInspector.UIString("Begin Capturing");
- var altToolTip = WebInspector.UIString("End Capturing");
</del><ins>+ toolTip = WebInspector.UIString("Begin Capturing");
+ altToolTip = WebInspector.UIString("End Capturing");
</ins><span class="cx"> this._replayCaptureButtonItem = new WebInspector.ActivateButtonNavigationItem("replay-capture", toolTip, altToolTip, "Images/Circle.svg", 16, 16);
</span><span class="cx"> this._replayCaptureButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._replayCaptureButtonClicked, this);
</span><span class="cx"> this._replayCaptureButtonItem.enabled = true;
</span><span class="lines">@@ -154,7 +161,7 @@
</span><span class="cx"> WebInspector.replayManager.addEventListener(WebInspector.ReplayManager.Event.CaptureStarted, this._captureStarted, this);
</span><span class="cx"> WebInspector.replayManager.addEventListener(WebInspector.ReplayManager.Event.CaptureStopped, this._captureStopped, this);
</span><span class="cx">
</span><del>- this._statusBarElement.oncontextmenu = this._contextMenuNavigationBarOrStatusBar.bind(this);
</del><ins>+ this._recordingNavigationBar.element.oncontextmenu = this._contextMenuNavigationBarOrStatusBar.bind(this);
</ins><span class="cx"> this._replayNavigationBar.element.oncontextmenu = this._contextMenuNavigationBarOrStatusBar.bind(this);
</span><span class="cx"> this._updateReplayInterfaceVisibility();
</span><span class="cx">
</span><span class="lines">@@ -162,8 +169,8 @@
</span><span class="cx"> WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.RecordingLoaded, this._recordingLoaded, this);
</span><span class="cx">
</span><span class="cx"> this.contentBrowser.addEventListener(WebInspector.ContentBrowser.Event.CurrentContentViewDidChange, this._contentBrowserCurrentContentViewDidChange, this);
</span><del>- WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingStarted, this._capturingStarted, this);
- WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingStopped, this._capturingStopped, this);
</del><ins>+ WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingStarted, this._capturingStartedOrStopped, this);
+ WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingStopped, this._capturingStartedOrStopped, this);
</ins><span class="cx">
</span><span class="cx"> for (var recording of WebInspector.timelineManager.recordings)
</span><span class="cx"> this._addRecording(recording);
</span><span class="lines">@@ -172,14 +179,6 @@
</span><span class="cx">
</span><span class="cx"> if (WebInspector.timelineManager.activeRecording)
</span><span class="cx"> this._recordingLoaded();
</span><del>-
- this._toggleRecordingShortcut = new WebInspector.KeyboardShortcut(null, WebInspector.KeyboardShortcut.Key.Space, this._toggleRecordingOnSpacebar.bind(this));
- this._toggleRecordingShortcut.implicitlyPreventsDefault = false;
- this._toggleRecordingShortcut.disabled = true;
-
- this._toggleNewRecordingShortcut = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Shift, WebInspector.KeyboardShortcut.Key.Space, this._toggleNewRecordingOnSpacebar.bind(this));
- this._toggleNewRecordingShortcut.implicitlyPreventsDefault = false;
- this._toggleNewRecordingShortcut.disabled = true;
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Public
</span><span class="lines">@@ -552,14 +551,10 @@
</span><span class="cx"> {
</span><span class="cx"> if (WebInspector.timelineManager.isCapturing()) {
</span><span class="cx"> WebInspector.timelineManager.stopCapturing();
</span><del>-
- this._recordGlyphElement.title = WebInspector.UIString("Click or press the spacebar to record.")
</del><span class="cx"> } else {
</span><span class="cx"> WebInspector.timelineManager.startCapturing(shouldCreateRecording);
</span><span class="cx"> // Show the timeline to which events will be appended.
</span><span class="cx"> this._recordingLoaded();
</span><del>-
- this._recordGlyphElement.title = WebInspector.UIString("Click or press the spacebar to stop recording.")
</del><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -635,18 +630,12 @@
</span><span class="cx"> this._refreshFrameSelectionChart();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- _capturingStarted(event)
</del><ins>+ _capturingStartedOrStopped(event)
</ins><span class="cx"> {
</span><del>- this._recordStatusElement.textContent = WebInspector.UIString("Recording");
- this._recordGlyphElement.classList.add(WebInspector.TimelineSidebarPanel.RecordGlyphRecordingStyleClass);
</del><ins>+ let isCapturing = WebInspector.timelineManager.isCapturing();
+ this._updateRecordButton(isCapturing);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- _capturingStopped(event)
- {
- this._recordStatusElement.textContent = "";
- this._recordGlyphElement.classList.remove(WebInspector.TimelineSidebarPanel.RecordGlyphRecordingStyleClass);
- }
-
</del><span class="cx"> _recordingCreated(event)
</span><span class="cx"> {
</span><span class="cx"> this._addRecording(event.data.recording)
</span><span class="lines">@@ -844,32 +833,34 @@
</span><span class="cx"> this.contentView.element.style.top = (overviewHeight + contentElementOffset) + "px";
</span><span class="cx"> }
</span><span class="cx">
</span><del>- _recordGlyphMousedOver(event)
</del><ins>+ _recordButtonClicked(event)
</ins><span class="cx"> {
</span><del>- this._recordGlyphElement.classList.remove(WebInspector.TimelineSidebarPanel.RecordGlyphRecordingForcedStyleClass);
</del><ins>+ let isCapturing = !WebInspector.timelineManager.isCapturing();
</ins><span class="cx">
</span><ins>+ this._updateRecordButton(isCapturing);
+ this._toggleRecording(event.shiftKey);
+ }
+
+ _recordButtonMousedOver(event)
+ {
</ins><span class="cx"> if (WebInspector.timelineManager.isCapturing())
</span><del>- this._recordStatusElement.textContent = WebInspector.UIString("Stop Recording");
</del><ins>+ this._recordingStatusItem.element.textContent = WebInspector.UIString("Stop Recording");
</ins><span class="cx"> else
</span><del>- this._recordStatusElement.textContent = WebInspector.UIString("Start Recording");
</del><ins>+ this._recordingStatusItem.element.textContent = WebInspector.UIString("Start Recording");
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- _recordGlyphMousedOut(event)
</del><ins>+ _recordButtonMousedOut(event)
</ins><span class="cx"> {
</span><del>- this._recordGlyphElement.classList.remove(WebInspector.TimelineSidebarPanel.RecordGlyphRecordingForcedStyleClass);
-
</del><span class="cx"> if (WebInspector.timelineManager.isCapturing())
</span><del>- this._recordStatusElement.textContent = WebInspector.UIString("Recording");
</del><ins>+ this._recordingStatusItem.element.textContent = WebInspector.UIString("Recording");
</ins><span class="cx"> else
</span><del>- this._recordStatusElement.textContent = "";
</del><ins>+ this._recordingStatusItem.element.textContent = "";
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- _recordGlyphClicked(event)
</del><ins>+ _updateRecordButton(isCapturing)
</ins><span class="cx"> {
</span><del>- // Add forced class to prevent the glyph from showing a confusing status after click.
- this._recordGlyphElement.classList.add(WebInspector.TimelineSidebarPanel.RecordGlyphRecordingForcedStyleClass);
-
- this._toggleRecording(event.shiftKey);
</del><ins>+ this._recordingStatusItem.element.textContent = isCapturing ? WebInspector.UIString("Recording") : "";
+ this._recordButton.toggled = isCapturing;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> _viewModeSelected(event)
</span><span class="lines">@@ -995,7 +986,7 @@
</span><span class="cx"> {
</span><span class="cx"> var shouldShowReplayInterface = !!(window.ReplayAgent && WebInspector.showReplayInterfaceSetting.value);
</span><span class="cx">
</span><del>- this._statusBarElement.classList.toggle(WebInspector.TimelineSidebarPanel.HiddenStyleClassName, shouldShowReplayInterface);
</del><ins>+ this._recordingNavigationBar.element.classList.toggle(WebInspector.TimelineSidebarPanel.HiddenStyleClassName, shouldShowReplayInterface);
</ins><span class="cx"> this._replayNavigationBar.element.classList.toggle(WebInspector.TimelineSidebarPanel.HiddenStyleClassName, !shouldShowReplayInterface);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1068,11 +1059,6 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> WebInspector.TimelineSidebarPanel.HiddenStyleClassName = "hidden";
</span><del>-WebInspector.TimelineSidebarPanel.StatusBarStyleClass = "status-bar";
-WebInspector.TimelineSidebarPanel.RecordGlyphStyleClass = "record-glyph";
-WebInspector.TimelineSidebarPanel.RecordGlyphRecordingStyleClass = "recording";
-WebInspector.TimelineSidebarPanel.RecordGlyphRecordingForcedStyleClass = "forced";
-WebInspector.TimelineSidebarPanel.RecordStatusStyleClass = "record-status";
</del><span class="cx"> WebInspector.TimelineSidebarPanel.TitleBarStyleClass = "title-bar";
</span><span class="cx"> WebInspector.TimelineSidebarPanel.TitleBarTextStyleClass = "title-bar-text";
</span><span class="cx"> WebInspector.TimelineSidebarPanel.TitleBarScopeBarStyleClass = "title-bar-scope-bar";
</span></span></pre>
</div>
</div>
</body>
</html>