Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: Source/devtools/front_end/components_lazy/FilmStripView.js

Issue 1208593003: DevTools: Make FilmStripView support custom status text. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/devtools/front_end/network/NetworkPanel.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @constructor 6 * @constructor
7 * @extends {WebInspector.HBox} 7 * @extends {WebInspector.HBox}
8 */ 8 */
9 WebInspector.FilmStripView = function() 9 WebInspector.FilmStripView = function()
10 { 10 {
11 WebInspector.HBox.call(this, true); 11 WebInspector.HBox.call(this, true);
12 this.registerRequiredCSS("components_lazy/filmStripView.css"); 12 this.registerRequiredCSS("components_lazy/filmStripView.css");
13 this.contentElement.classList.add("film-strip-view"); 13 this.contentElement.classList.add("film-strip-view");
14 this._statusLabel = this.contentElement.createChild("div", "label");
14 this.reset(); 15 this.reset();
15 this.setMode(WebInspector.FilmStripView.Modes.TimeBased); 16 this.setMode(WebInspector.FilmStripView.Modes.TimeBased);
16 } 17 }
17 18
18 WebInspector.FilmStripView.Events = { 19 WebInspector.FilmStripView.Events = {
19 FrameSelected: "FrameSelected", 20 FrameSelected: "FrameSelected",
20 FrameEnter: "FrameEnter", 21 FrameEnter: "FrameEnter",
21 FrameExit: "FrameExit", 22 FrameExit: "FrameExit",
22 } 23 }
23 24
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 105
105 update: function() 106 update: function()
106 { 107 {
107 if (!this._model) 108 if (!this._model)
108 return; 109 return;
109 var frames = this._model.frames(); 110 var frames = this._model.frames();
110 if (!frames.length) 111 if (!frames.length)
111 return; 112 return;
112 113
113 this.contentElement.removeChildren(); 114 this.contentElement.removeChildren();
114 this._statusLabel.remove();
115 115
116 if (this._mode === WebInspector.FilmStripView.Modes.FrameBased) { 116 if (this._mode === WebInspector.FilmStripView.Modes.FrameBased) {
117 Promise.all(frames.map(this.createFrameElement.bind(this))).spread(t his.contentElement.appendChildren.bind(this.contentElement)); 117 Promise.all(frames.map(this.createFrameElement.bind(this))).spread(t his.contentElement.appendChildren.bind(this.contentElement));
118 return; 118 return;
119 } 119 }
120 120
121 var width = this.contentElement.clientWidth; 121 var width = this.contentElement.clientWidth;
122 var scale = this._spanTime / width; 122 var scale = this._spanTime / width;
123 this.createFrameElement(frames[0]).then(continueWhenFrameImageLoaded.bin d(this)); // Calculate frame width basing on the first frame. 123 this.createFrameElement(frames[0]).then(continueWhenFrameImageLoaded.bin d(this)); // Calculate frame width basing on the first frame.
124 124
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 */ 174 */
175 _onDoubleClick: function(filmStripFrame) 175 _onDoubleClick: function(filmStripFrame)
176 { 176 {
177 WebInspector.Dialog.show(null, new WebInspector.FilmStripView.DialogDele gate(filmStripFrame, this._zeroTime)); 177 WebInspector.Dialog.show(null, new WebInspector.FilmStripView.DialogDele gate(filmStripFrame, this._zeroTime));
178 }, 178 },
179 179
180 reset: function() 180 reset: function()
181 { 181 {
182 this._zeroTime = 0; 182 this._zeroTime = 0;
183 this.contentElement.removeChildren(); 183 this.contentElement.removeChildren();
184 this._statusLabel = this.contentElement.createChild("div", "label"); 184 this.contentElement.appendChild(this._statusLabel);
185 this._statusLabel.textContent = WebInspector.UIString("No frames recorde d. Reload page to start recording.");
186 }, 185 },
187 186
188 setRecording: function() 187 /**
188 * @param {string} text
189 */
190 setStatusText: function(text)
189 { 191 {
190 this.reset(); 192 this._statusLabel.textContent = text;
191 this._statusLabel.textContent = WebInspector.UIString("Recording frames. ..");
192 },
193
194 setFetching: function()
195 {
196 this._statusLabel.textContent = WebInspector.UIString("Fetching frames.. .");
197 }, 193 },
198 194
199 __proto__: WebInspector.HBox.prototype 195 __proto__: WebInspector.HBox.prototype
200 } 196 }
201 197
202 /** 198 /**
203 * @param {!Element} imageElement 199 * @param {!Element} imageElement
204 * @param {?string} data 200 * @param {?string} data
205 */ 201 */
206 WebInspector.FilmStripView._setImageData = function(imageElement, data) 202 WebInspector.FilmStripView._setImageData = function(imageElement, data)
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 304
309 _render: function() 305 _render: function()
310 { 306 {
311 var frame = this._frames[this._index]; 307 var frame = this._frames[this._index];
312 frame.imageDataPromise().then(WebInspector.FilmStripView._setImageData.b ind(null, this._imageElement)); 308 frame.imageDataPromise().then(WebInspector.FilmStripView._setImageData.b ind(null, this._imageElement));
313 this._timeLabel.textContent = Number.millisToString(frame.timestamp - th is._zeroTime); 309 this._timeLabel.textContent = Number.millisToString(frame.timestamp - th is._zeroTime);
314 }, 310 },
315 311
316 __proto__: WebInspector.DialogDelegate.prototype 312 __proto__: WebInspector.DialogDelegate.prototype
317 } 313 }
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/network/NetworkPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698