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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/perf_ui/FilmStripView.js

Issue 2702523003: [DevTools] Continue GlassPane refactoring. (Closed)
Patch Set: element Created 3 years, 10 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
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 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 PerfUI.FilmStripView = class extends UI.HBox { 7 PerfUI.FilmStripView = class extends UI.HBox {
8 constructor() { 8 constructor() {
9 super(true); 9 super(true);
10 this.registerRequiredCSS('perf_ui/filmStripView.css'); 10 this.registerRequiredCSS('perf_ui/filmStripView.css');
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 footerElement.createChild('div', 'flex-auto'); 233 footerElement.createChild('div', 'flex-auto');
234 234
235 this.contentElement.addEventListener('keydown', this._keyDown.bind(this), fa lse); 235 this.contentElement.addEventListener('keydown', this._keyDown.bind(this), fa lse);
236 this.setDefaultFocusedElement(this.contentElement); 236 this.setDefaultFocusedElement(this.contentElement);
237 this._render(); 237 this._render();
238 } 238 }
239 239
240 _resize() { 240 _resize() {
241 if (!this._dialog) { 241 if (!this._dialog) {
242 this._dialog = new UI.Dialog(); 242 this._dialog = new UI.Dialog();
243 this.show(this._dialog.element); 243 this.show(this._dialog.contentElement);
244 this._dialog.setWrapsContent(true); 244 this._dialog.showDialog();
245 this._dialog.show();
246 } 245 }
247 this._dialog.contentResized(); 246 this._dialog.setSizeBehavior(UI.GlassPane.SizeBehavior.MeasureContent);
248 } 247 }
249 248
250 /** 249 /**
251 * @param {!Event} event 250 * @param {!Event} event
252 */ 251 */
253 _keyDown(event) { 252 _keyDown(event) {
254 switch (event.key) { 253 switch (event.key) {
255 case 'ArrowLeft': 254 case 'ArrowLeft':
256 if (Host.isMac() && event.metaKey) 255 if (Host.isMac() && event.metaKey)
257 this._onFirstFrame(); 256 this._onFirstFrame();
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 * @return {!Promise<undefined>} 301 * @return {!Promise<undefined>}
303 */ 302 */
304 _render() { 303 _render() {
305 var frame = this._frames[this._index]; 304 var frame = this._frames[this._index];
306 this._timeLabel.textContent = Number.millisToString(frame.timestamp - this._ zeroTime); 305 this._timeLabel.textContent = Number.millisToString(frame.timestamp - this._ zeroTime);
307 return frame.imageDataPromise() 306 return frame.imageDataPromise()
308 .then(PerfUI.FilmStripView._setImageData.bind(null, this._imageElement)) 307 .then(PerfUI.FilmStripView._setImageData.bind(null, this._imageElement))
309 .then(this._resize.bind(this)); 308 .then(this._resize.bind(this));
310 } 309 }
311 }; 310 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698