<!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>[172420] 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/172420">172420</a></dd>
<dt>Author</dt> <dd>burg@cs.washington.edu</dd>
<dt>Date</dt> <dd>2014-08-11 16:41:15 -0700 (Mon, 11 Aug 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Inspector: show a replay dashboard when capturing or replaying
https://bugs.webkit.org/show_bug.cgi?id=135170
Reviewed by Timothy Hatcher.
This patch adds a replay dashboard with record/play/pause buttons. It
is shown automatically when the user starts capturing an execution from
the replay menu in the Timelines sidebar panel.
* UserInterface/Base/Main.js:
(WebInspector.loaded):
(WebInspector._captureDidStart):
* UserInterface/Controllers/DashboardManager.js:
(WebInspector.DashboardManager):
* UserInterface/Images/ReplayPauseButton.svg: Added.
* UserInterface/Images/ReplayPlayButton.svg: Added.
* UserInterface/Images/ReplayRecordingButton.svg: Added.
* UserInterface/Main.html:
* UserInterface/Models/ReplayDashboard.js: Copied from Source/WebInspectorUI/UserInterface/Controllers/DashboardManager.js.
(WebInspector.ReplayDashboard):
* UserInterface/Views/DashboardView.js:
(WebInspector.DashboardView):
* UserInterface/Views/ReplayDashboardView.css: Copied from Source/WebInspectorUI/UserInterface/Controllers/DashboardManager.js.
(.toolbar .dashboard.replay):
(.toolbar .dashboard.replay div.navigation-bar):
(.toolbar .dashboard.replay .item.button > .glyph):
(.toolbar.label-only .dashboard.replay .item.button > .glyph):
* UserInterface/Views/ReplayDashboardView.js: Added.
(WebInspector.ReplayDashboardView):
(WebInspector.ReplayDashboardView.prototype._captureButtonItemClicked):
(WebInspector.ReplayDashboardView.prototype._replayButtonItemClicked):
(WebInspector.ReplayDashboardView.prototype._captureStarted):
(WebInspector.ReplayDashboardView.prototype._captureStopped):
(WebInspector.ReplayDashboardView.prototype._playbackStarted):
(WebInspector.ReplayDashboardView.prototype._playbackPaused):
(WebInspector.ReplayDashboardView.prototype._playbackFinished):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseMainjs">trunk/Source/WebInspectorUI/UserInterface/Base/Main.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersDashboardManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/DashboardManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceMainhtml">trunk/Source/WebInspectorUI/UserInterface/Main.html</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDashboardViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/DashboardView.js</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImagesReplayPauseButtonsvg">trunk/Source/WebInspectorUI/UserInterface/Images/ReplayPauseButton.svg</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImagesReplayPlayButtonsvg">trunk/Source/WebInspectorUI/UserInterface/Images/ReplayPlayButton.svg</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImagesReplayRecordingButtonsvg">trunk/Source/WebInspectorUI/UserInterface/Images/ReplayRecordingButton.svg</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsReplayDashboardjs">trunk/Source/WebInspectorUI/UserInterface/Models/ReplayDashboard.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsReplayDashboardViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/ReplayDashboardView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsReplayDashboardViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ReplayDashboardView.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (172419 => 172420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2014-08-11 23:40:52 UTC (rev 172419)
+++ trunk/Source/WebInspectorUI/ChangeLog        2014-08-11 23:41:15 UTC (rev 172420)
</span><span class="lines">@@ -1,3 +1,42 @@
</span><ins>+2014-08-11 Brian J. Burg <burg@cs.washington.edu>
+
+ Web Inspector: show a replay dashboard when capturing or replaying
+ https://bugs.webkit.org/show_bug.cgi?id=135170
+
+ Reviewed by Timothy Hatcher.
+
+ This patch adds a replay dashboard with record/play/pause buttons. It
+ is shown automatically when the user starts capturing an execution from
+ the replay menu in the Timelines sidebar panel.
+
+ * UserInterface/Base/Main.js:
+ (WebInspector.loaded):
+ (WebInspector._captureDidStart):
+ * UserInterface/Controllers/DashboardManager.js:
+ (WebInspector.DashboardManager):
+ * UserInterface/Images/ReplayPauseButton.svg: Added.
+ * UserInterface/Images/ReplayPlayButton.svg: Added.
+ * UserInterface/Images/ReplayRecordingButton.svg: Added.
+ * UserInterface/Main.html:
+ * UserInterface/Models/ReplayDashboard.js: Copied from Source/WebInspectorUI/UserInterface/Controllers/DashboardManager.js.
+ (WebInspector.ReplayDashboard):
+ * UserInterface/Views/DashboardView.js:
+ (WebInspector.DashboardView):
+ * UserInterface/Views/ReplayDashboardView.css: Copied from Source/WebInspectorUI/UserInterface/Controllers/DashboardManager.js.
+ (.toolbar .dashboard.replay):
+ (.toolbar .dashboard.replay div.navigation-bar):
+ (.toolbar .dashboard.replay .item.button > .glyph):
+ (.toolbar.label-only .dashboard.replay .item.button > .glyph):
+ * UserInterface/Views/ReplayDashboardView.js: Added.
+ (WebInspector.ReplayDashboardView):
+ (WebInspector.ReplayDashboardView.prototype._captureButtonItemClicked):
+ (WebInspector.ReplayDashboardView.prototype._replayButtonItemClicked):
+ (WebInspector.ReplayDashboardView.prototype._captureStarted):
+ (WebInspector.ReplayDashboardView.prototype._captureStopped):
+ (WebInspector.ReplayDashboardView.prototype._playbackStarted):
+ (WebInspector.ReplayDashboardView.prototype._playbackPaused):
+ (WebInspector.ReplayDashboardView.prototype._playbackFinished):
+
</ins><span class="cx"> 2014-08-08 Brian J. Burg <burg@cs.washington.edu>
</span><span class="cx">
</span><span class="cx"> Web Inspector: DebuggerManager commands should return promises
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseMainjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Main.js (172419 => 172420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Base/Main.js        2014-08-11 23:40:52 UTC (rev 172419)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Main.js        2014-08-11 23:41:15 UTC (rev 172420)
</span><span class="lines">@@ -124,6 +124,7 @@
</span><span class="cx"> ConsoleAgent.enable();
</span><span class="cx">
</span><span class="cx"> // Register for events.
</span><ins>+ this.replayManager.addEventListener(WebInspector.ReplayManager.Event.CaptureStarted, this._captureDidStart, this);
</ins><span class="cx"> this.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.Paused, this._debuggerDidPause, this);
</span><span class="cx"> this.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.Resumed, this._debuggerDidResume, this);
</span><span class="cx"> this.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.InspectModeStateChanged, this._inspectModeStateChanged, this);
</span><span class="lines">@@ -742,6 +743,11 @@
</span><span class="cx"> event.preventDefault();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+WebInspector._captureDidStart = function(event)
+{
+ this.dashboardContainer.showDashboardViewForRepresentedObject(this.dashboardManager.dashboards.replay);
+}
+
</ins><span class="cx"> WebInspector._debuggerDidPause = function(event)
</span><span class="cx"> {
</span><span class="cx"> this.debuggerSidebarPanel.show();
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersDashboardManagerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/DashboardManager.js (172419 => 172420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/DashboardManager.js        2014-08-11 23:40:52 UTC (rev 172419)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/DashboardManager.js        2014-08-11 23:41:15 UTC (rev 172420)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> this._dashboards = {};
</span><span class="cx"> this._dashboards.default = new WebInspector.DefaultDashboard;
</span><span class="cx"> this._dashboards.debugger = new WebInspector.DebuggerDashboard;
</span><ins>+ this._dashboards.replay = new WebInspector.ReplayDashboard;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> WebInspector.DashboardManager.prototype = {
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImagesReplayPauseButtonsvg"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Images/ReplayPauseButton.svg (0 => 172420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Images/ReplayPauseButton.svg         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/ReplayPauseButton.svg        2014-08-11 23:41:15 UTC (rev 172420)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ width="36px" height="36px" viewBox="0 0 36 36" enable-background="new 0 0 36 36" xml:space="preserve">
+<g>
+ <rect x="5.656" y="4.202" width="9.255" height="27.597"/>
+ <rect x="21.09" y="4.202" width="9.254" height="27.597"/>
+</g>
+</svg>
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImagesReplayPlayButtonsvg"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Images/ReplayPlayButton.svg (0 => 172420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Images/ReplayPlayButton.svg         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/ReplayPlayButton.svg        2014-08-11 23:41:15 UTC (rev 172420)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ width="36px" height="36px" viewBox="0 0 36 36" enable-background="new 0 0 36 36" xml:space="preserve">
+<polygon fill="#38AF4A" points="5.625,4.21 30.375,18 5.625,31.79 "/>
+</svg>
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImagesReplayRecordingButtonsvg"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Images/ReplayRecordingButton.svg (0 => 172420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Images/ReplayRecordingButton.svg         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/ReplayRecordingButton.svg        2014-08-11 23:41:15 UTC (rev 172420)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ width="36px" height="36px" viewBox="0 0 36 36" enable-background="new 0 0 36 36" xml:space="preserve">
+<circle fill="#EE2D24" cx="18" cy="18" r="13.605"/>
+</svg>
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceMainhtml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Main.html (172419 => 172420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Main.html        2014-08-11 23:40:52 UTC (rev 172419)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.html        2014-08-11 23:41:15 UTC (rev 172420)
</span><span class="lines">@@ -106,6 +106,7 @@
</span><span class="cx"> <link rel="stylesheet" href="Views/ProbeSetDataGrid.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/QuickConsole.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/RadioButtonNavigationItem.css">
</span><ins>+ <link rel="stylesheet" href="Views/ReplayDashboardView.css">
</ins><span class="cx"> <link rel="stylesheet" href="Views/ResourceIcons.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/ResourceSidebarPanel.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/ResourceTreeElement.css">
</span><span class="lines">@@ -249,6 +250,7 @@
</span><span class="cx"> <script src="Models/Profile.js"></script>
</span><span class="cx"> <script src="Models/ProfileNode.js"></script>
</span><span class="cx"> <script src="Models/ProfileNodeCall.js"></script>
</span><ins>+ <script src="Models/ReplayDashboard.js"></script>
</ins><span class="cx"> <script src="Models/ReplaySession.js"></script>
</span><span class="cx"> <script src="Models/ReplaySessionSegment.js"></script>
</span><span class="cx"> <script src="Models/Resource.js"></script>
</span><span class="lines">@@ -420,6 +422,7 @@
</span><span class="cx"> <script src="Views/QuickConsole.js"></script>
</span><span class="cx"> <script src="Views/QuickConsoleNavigationBar.js"></script>
</span><span class="cx"> <script src="Views/RadioButtonNavigationItem.js"></script>
</span><ins>+ <script src="Views/ReplayDashboardView.js"></script>
</ins><span class="cx"> <script src="Views/ResourceClusterContentView.js"></script>
</span><span class="cx"> <script src="Views/ResourceDetailsSidebarPanel.js"></script>
</span><span class="cx"> <script src="Views/ResourceSidebarPanel.js"></script>
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsReplayDashboardjsfromrev172418trunkSourceWebInspectorUIUserInterfaceControllersDashboardManagerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Models/ReplayDashboard.js (from rev 172418, trunk/Source/WebInspectorUI/UserInterface/Controllers/DashboardManager.js) (0 => 172420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ReplayDashboard.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ReplayDashboard.js        2014-08-11 23:41:15 UTC (rev 172420)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ * Copyright (C) 2014 University of Washington. 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.ReplayDashboard = function() {
+ WebInspector.Object.call(this);
+};
+
+WebInspector.ReplayDashboard.prototype = {
+ constructor: WebInspector.ReplayDashboard,
+ __proto__: WebInspector.Object.prototype,
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDashboardViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DashboardView.js (172419 => 172420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DashboardView.js        2014-08-11 23:40:52 UTC (rev 172419)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DashboardView.js        2014-08-11 23:41:15 UTC (rev 172420)
</span><span class="lines">@@ -35,6 +35,9 @@
</span><span class="cx"> if (representedObject instanceof WebInspector.DebuggerDashboard)
</span><span class="cx"> return new WebInspector.DebuggerDashboardView(representedObject);
</span><span class="cx">
</span><ins>+ if (representedObject instanceof WebInspector.ReplayDashboard)
+ return new WebInspector.ReplayDashboardView(representedObject);
+
</ins><span class="cx"> throw "Can't make a DashboardView for an unknown representedObject.";
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsReplayDashboardViewcssfromrev172418trunkSourceWebInspectorUIUserInterfaceControllersDashboardManagerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/ReplayDashboardView.css (from rev 172418, trunk/Source/WebInspectorUI/UserInterface/Controllers/DashboardManager.js) (0 => 172420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ReplayDashboardView.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ReplayDashboardView.css        2014-08-11 23:41:15 UTC (rev 172420)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+/*
+ * Copyright (C) 2014 University of Washington. 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.
+ */
+.toolbar .dashboard.replay {
+ display: -webkit-flex;
+ -webkit-flex-wrap: nowrap;
+ -webkit-justify-content: center;
+ -webkit-align-items: center;
+
+ text-align: center;
+ text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;
+ color: rgb(60, 60, 60);
+ padding: 0 5px;
+}
+
+.toolbar .dashboard.replay div.navigation-bar {
+ border-bottom: none !important;
+}
+
+.toolbar .dashboard.replay .item.button > .glyph {
+ /* ButtonNavigationItem is not aware of alternate button sizes, so override here. */
+ width: 16px !important;
+ height: 16px !important;
+}
+
+.toolbar.label-only .dashboard.replay .item.button > .glyph {
+ /* The default styles here will try to elide buttons in label-only mode. */
+ display: -webkit-flex !important;
+
+ /* ButtonNavigationItem is not aware of alternate button sizes, so override here. */
+ width: 14px !important;
+ height: 14px !important;
+}
+
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsReplayDashboardViewjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/ReplayDashboardView.js (0 => 172420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ReplayDashboardView.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ReplayDashboardView.js        2014-08-11 23:41:15 UTC (rev 172420)
</span><span class="lines">@@ -0,0 +1,126 @@
</span><ins>+/*
+ * Copyright (C) 2014 University of Washington. 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.ReplayDashboardView = function(representedObject)
+{
+ WebInspector.DashboardView.call(this, representedObject, "replay");
+
+ this._navigationBar = new WebInspector.NavigationBar;
+ this.element.appendChild(this._navigationBar.element);
+
+ replayManager = WebInspector.replayManager;
+
+ this._captureButtonItem = new WebInspector.ActivateButtonNavigationItem("replay-dashboard-capture", WebInspector.UIString("Start Recording"), WebInspector.UIString("Stop Recording"), "Images/ReplayRecordingButton.svg", 16, 16);
+ this._captureButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._captureButtonItemClicked, this);
+ this._captureButtonItem.hidden = true;
+ this._navigationBar.addNavigationItem(this._captureButtonItem);
+
+ this._replayButtonItem = new WebInspector.ToggleButtonNavigationItem("replay-dashboard-replay", WebInspector.UIString("Start Playback"), WebInspector.UIString("Pause Playback"), "Images/ReplayPlayButton.svg", "Images/ReplayPauseButton.svg", 16, 16);
+ this._replayButtonItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._replayButtonItemClicked, this);
+ this._replayButtonItem.hidden = true;
+ this._navigationBar.addNavigationItem(this._replayButtonItem);
+
+ // Add events required to track capture and replay state.
+ WebInspector.replayManager.addEventListener(WebInspector.ReplayManager.Event.CaptureStarted, this._captureStarted, this);
+ WebInspector.replayManager.addEventListener(WebInspector.ReplayManager.Event.CaptureStopped, this._captureStopped, this);
+ WebInspector.replayManager.addEventListener(WebInspector.ReplayManager.Event.PlaybackStarted, this._playbackStarted, this);
+ WebInspector.replayManager.addEventListener(WebInspector.ReplayManager.Event.PlaybackPaused, this._playbackPaused, this);
+ WebInspector.replayManager.addEventListener(WebInspector.ReplayManager.Event.PlaybackFinished, this._playbackFinished, this);
+
+ // Manually initialize style classes by querying current replay state.
+ if (WebInspector.replayManager.sessionState === WebInspector.ReplayManager.SessionState.Capturing)
+ this._captureStarted();
+ else if (WebInspector.replayManager.sessionState === WebInspector.ReplayManager.SessionState.Inactive)
+ this._captureStopped();
+ // ReplayManager.sessionState must be Replaying.
+ else if (WebInspector.replayManager.segmentState === WebInspector.ReplayManager.SegmentState.Dispatching)
+ this._playbackStarted();
+ // ReplayManager.sessionState must be Unloaded or Loaded, so execution is paused.
+ else
+ this._playbackPaused();
+};
+
+// Class names for top-level flex items within the replay dashboard.
+WebInspector.ReplayDashboardView.RecordingContainerStyleClassName = "recording-container";
+
+// Class names for single buttons.
+WebInspector.ReplayDashboardView.RecordButtonStyleClassName = "record-button";
+WebInspector.ReplayDashboardView.ReplayButtonStyleClassName = "replay-button";
+
+WebInspector.ReplayDashboardView.prototype = {
+ constructor: WebInspector.ReplayDashboardView,
+ __proto__: WebInspector.DashboardView.prototype,
+
+ // Private
+
+ _captureButtonItemClicked: function()
+ {
+ if (WebInspector.replayManager.sessionState !== WebInspector.ReplayManager.SessionState.Capturing)
+ WebInspector.replayManager.startCapturing();
+ else
+ WebInspector.replayManager.stopCapturing();
+ },
+
+ _replayButtonItemClicked: function(event)
+ {
+ console.assert(WebInspector.replayManager.sessionState !== WebInspector.ReplayManager.SessionState.Capturing, "Tried to start replaying while SessionState is Capturing!");
+
+ if (WebInspector.replayManager.sessionState === WebInspector.ReplayManager.SessionState.Inactive)
+ WebInspector.replayManager.replayToCompletion();
+ else if (WebInspector.replayManager.segmentState === WebInspector.ReplayManager.SegmentState.Dispatching)
+ WebInspector.replayManager.pausePlayback();
+ else
+ WebInspector.replayManager.replayToCompletion();
+ },
+
+ _captureStarted: function()
+ {
+ this._captureButtonItem.hidden = false;
+ this._captureButtonItem.activated = true;
+ this._replayButtonItem.hidden = true;
+ },
+
+ _captureStopped: function()
+ {
+ this._captureButtonItem.activated = false;
+ this._captureButtonItem.hidden = true;
+ this._replayButtonItem.hidden = false;
+ },
+
+ _playbackStarted: function()
+ {
+ this._replayButtonItem.toggled = true;
+ },
+
+ _playbackPaused: function()
+ {
+ this._replayButtonItem.toggled = false;
+ },
+
+ _playbackFinished: function()
+ {
+ this._replayButtonItem.toggled = false;
+ }
+};
</ins></span></pre>
</div>
</div>
</body>
</html>