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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineHistoryManager.js

Issue 2916743002: [DevTools] Introduce Common.List used as a backend for list controls (Closed)
Patch Set: Created 3 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 Timeline.TimelineHistoryManager = class { 5 Timeline.TimelineHistoryManager = class {
6 constructor() { 6 constructor() {
7 /** @type {!Array<!Timeline.PerformanceModel>} */ 7 /** @type {!Array<!Timeline.PerformanceModel>} */
8 this._recordings = []; 8 this._recordings = [];
9 this._action = UI.actionRegistry.action('timeline.show-history'); 9 this._action = UI.actionRegistry.action('timeline.show-history');
10 this._action.setEnabled(false); 10 this._action.setEnabled(false);
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 this._glassPane.setOutsideClickCallback(() => this._close(null)); 248 this._glassPane.setOutsideClickCallback(() => this._close(null));
249 this._glassPane.setPointerEventsBehavior(UI.GlassPane.PointerEventsBehavior. BlockedByGlassPane); 249 this._glassPane.setPointerEventsBehavior(UI.GlassPane.PointerEventsBehavior. BlockedByGlassPane);
250 this._glassPane.setAnchorBehavior(UI.GlassPane.AnchorBehavior.PreferBottom); 250 this._glassPane.setAnchorBehavior(UI.GlassPane.AnchorBehavior.PreferBottom);
251 251
252 var shadowRoot = 252 var shadowRoot =
253 UI.createShadowRootWithCoreStyles(this._glassPane.contentElement, 'timel ine/timelineHistoryManager.css'); 253 UI.createShadowRootWithCoreStyles(this._glassPane.contentElement, 'timel ine/timelineHistoryManager.css');
254 var contentElement = shadowRoot.createChild('div', 'drop-down'); 254 var contentElement = shadowRoot.createChild('div', 'drop-down');
255 255
256 this._listControl = new UI.ListControl(this, UI.ListMode.NonViewport); 256 this._listControl = new UI.ListControl(this, UI.ListMode.NonViewport);
257 this._listControl.element.addEventListener('mousemove', this._onMouseMove.bi nd(this), false); 257 this._listControl.element.addEventListener('mousemove', this._onMouseMove.bi nd(this), false);
258 this._listControl.replaceAllItems(models); 258 this._listControl.source().replaceAllItems(models);
259 259
260 contentElement.appendChild(this._listControl.element); 260 contentElement.appendChild(this._listControl.element);
261 contentElement.addEventListener('keydown', this._onKeyDown.bind(this), false ); 261 contentElement.addEventListener('keydown', this._onKeyDown.bind(this), false );
262 contentElement.addEventListener('click', this._onClick.bind(this), false); 262 contentElement.addEventListener('click', this._onClick.bind(this), false);
263 263
264 /** @type {?function(?Timeline.PerformanceModel)} */ 264 /** @type {?function(?Timeline.PerformanceModel)} */
265 this._selectionDone = null; 265 this._selectionDone = null;
266 } 266 }
267 267
268 /** 268 /**
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 action.addEventListener(UI.Action.Events.Enabled, data => this.setEnabled(/* * @type {boolean} */ (data))); 412 action.addEventListener(UI.Action.Events.Enabled, data => this.setEnabled(/* * @type {boolean} */ (data)));
413 } 413 }
414 414
415 /** 415 /**
416 * @param {string} text 416 * @param {string} text
417 */ 417 */
418 setText(text) { 418 setText(text) {
419 this._contentElement.textContent = text; 419 this._contentElement.textContent = text;
420 } 420 }
421 }; 421 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698