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

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: addressed comments 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 this._glassPane = new UI.GlassPane(); 246 this._glassPane = new UI.GlassPane();
247 this._glassPane.setSizeBehavior(UI.GlassPane.SizeBehavior.MeasureContent); 247 this._glassPane.setSizeBehavior(UI.GlassPane.SizeBehavior.MeasureContent);
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 var listModel = new UI.ListModel();
257 this._listControl = new UI.ListControl(listModel, this, UI.ListMode.NonViewp ort);
257 this._listControl.element.addEventListener('mousemove', this._onMouseMove.bi nd(this), false); 258 this._listControl.element.addEventListener('mousemove', this._onMouseMove.bi nd(this), false);
258 this._listControl.replaceAllItems(models); 259 listModel.replaceAllItems(models);
259 260
260 contentElement.appendChild(this._listControl.element); 261 contentElement.appendChild(this._listControl.element);
261 contentElement.addEventListener('keydown', this._onKeyDown.bind(this), false ); 262 contentElement.addEventListener('keydown', this._onKeyDown.bind(this), false );
262 contentElement.addEventListener('click', this._onClick.bind(this), false); 263 contentElement.addEventListener('click', this._onClick.bind(this), false);
263 264
264 /** @type {?function(?Timeline.PerformanceModel)} */ 265 /** @type {?function(?Timeline.PerformanceModel)} */
265 this._selectionDone = null; 266 this._selectionDone = null;
266 } 267 }
267 268
268 /** 269 /**
(...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))); 413 action.addEventListener(UI.Action.Events.Enabled, data => this.setEnabled(/* * @type {boolean} */ (data)));
413 } 414 }
414 415
415 /** 416 /**
416 * @param {string} text 417 * @param {string} text
417 */ 418 */
418 setText(text) { 419 setText(text) {
419 this._contentElement.textContent = text; 420 this._contentElement.textContent = text;
420 } 421 }
421 }; 422 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698