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

Side by Side Diff: Source/devtools/front_end/timeline/TimelineView.js

Issue 1113813002: [DevTools] Rename View to Widget. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 5 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 this._model = model; 45 this._model = model;
46 this._presentationModel = new WebInspector.TimelinePresentationModel(model); 46 this._presentationModel = new WebInspector.TimelinePresentationModel(model);
47 this._calculator = new WebInspector.TimelineCalculator(model); 47 this._calculator = new WebInspector.TimelineCalculator(model);
48 this._linkifier = new WebInspector.Linkifier(); 48 this._linkifier = new WebInspector.Linkifier();
49 this._frameStripByFrame = new Map(); 49 this._frameStripByFrame = new Map();
50 50
51 this._boundariesAreValid = true; 51 this._boundariesAreValid = true;
52 this._scrollTop = 0; 52 this._scrollTop = 0;
53 53
54 this._recordsView = this._createRecordsView(); 54 this._recordsView = this._createRecordsView();
55 this._recordsView.addEventListener(WebInspector.SplitView.Events.SidebarSize Changed, this._sidebarResized, this); 55 this._recordsView.addEventListener(WebInspector.SplitWidget.Events.SidebarSi zeChanged, this._sidebarResized, this);
56 56
57 this._topGapElement = this.element.createChild("div", "timeline-gap"); 57 this._topGapElement = this.element.createChild("div", "timeline-gap");
58 this._recordsView.show(this.element); 58 this._recordsView.show(this.element);
59 this._bottomGapElement = this.element.createChild("div", "timeline-gap"); 59 this._bottomGapElement = this.element.createChild("div", "timeline-gap");
60 60
61 this._headerElement = this.element.createChild("div", "fill"); 61 this._headerElement = this.element.createChild("div", "fill");
62 this._headerElement.id = "timeline-graph-records-header"; 62 this._headerElement.id = "timeline-graph-records-header";
63 63
64 // Create gpu tasks containers. 64 // Create gpu tasks containers.
65 this._cpuBarsElement = this._headerElement.createChild("div", "timeline-util ization-strip"); 65 this._cpuBarsElement = this._headerElement.createChild("div", "timeline-util ization-strip");
(...skipping 12 matching lines...) Expand all
78 WebInspector.TimelineView.prototype = { 78 WebInspector.TimelineView.prototype = {
79 /** 79 /**
80 * @param {?WebInspector.TimelineFrameModelBase} frameModel 80 * @param {?WebInspector.TimelineFrameModelBase} frameModel
81 */ 81 */
82 setFrameModel: function(frameModel) 82 setFrameModel: function(frameModel)
83 { 83 {
84 this._frameModel = frameModel; 84 this._frameModel = frameModel;
85 }, 85 },
86 86
87 /** 87 /**
88 * @return {!WebInspector.SplitView} 88 * @return {!WebInspector.SplitWidget}
89 */ 89 */
90 _createRecordsView: function() 90 _createRecordsView: function()
91 { 91 {
92 this._containerElement = this.element; 92 this._containerElement = this.element;
93 this._containerElement.tabIndex = 0; 93 this._containerElement.tabIndex = 0;
94 this._containerElement.id = "timeline-container"; 94 this._containerElement.id = "timeline-container";
95 this._containerElement.addEventListener("scroll", this._onScroll.bind(th is), false); 95 this._containerElement.addEventListener("scroll", this._onScroll.bind(th is), false);
96 96
97 var recordsView = new WebInspector.SplitView(true, false, "timelinePanel RecorsSplitViewState"); 97 var recordsView = new WebInspector.SplitWidget(true, false, "timelinePan elRecorsSplitViewState");
98 recordsView.element.style.flex = "1 0 auto"; 98 recordsView.element.style.flex = "1 0 auto";
99 99
100 // Create records list in the records sidebar. 100 // Create records list in the records sidebar.
101 var sidebarView = new WebInspector.VBox(); 101 var sidebarWidget = new WebInspector.VBox();
102 sidebarView.element.createChild("div", "timeline-records-title").textCon tent = WebInspector.UIString("RECORDS"); 102 sidebarWidget.element.createChild("div", "timeline-records-title").textC ontent = WebInspector.UIString("RECORDS");
103 recordsView.setSidebarView(sidebarView); 103 recordsView.setSidebarWidget(sidebarWidget);
104 this._sidebarListElement = sidebarView.element.createChild("div", "timel ine-records-list"); 104 this._sidebarListElement = sidebarWidget.element.createChild("div", "tim eline-records-list");
105 105
106 // Create grid in the records main area. 106 // Create grid in the records main area.
107 this._gridContainer = new WebInspector.VBoxWithResizeCallback(this._onVi ewportResize.bind(this)); 107 this._gridContainer = new WebInspector.VBoxWithResizeCallback(this._onVi ewportResize.bind(this));
108 this._gridContainer.element.id = "resources-container-content"; 108 this._gridContainer.element.id = "resources-container-content";
109 recordsView.setMainView(this._gridContainer); 109 recordsView.setMainWidget(this._gridContainer);
110 this._timelineGrid = new WebInspector.TimelineGrid(); 110 this._timelineGrid = new WebInspector.TimelineGrid();
111 this._gridContainer.element.appendChild(this._timelineGrid.element); 111 this._gridContainer.element.appendChild(this._timelineGrid.element);
112 112
113 this._itemsGraphsElement = this._gridContainer.element.createChild("div" ); 113 this._itemsGraphsElement = this._gridContainer.element.createChild("div" );
114 this._itemsGraphsElement.id = "timeline-graphs"; 114 this._itemsGraphsElement.id = "timeline-graphs";
115 115
116 // Create gap elements 116 // Create gap elements
117 this._graphRowsElement = this._itemsGraphsElement.createChild("div"); 117 this._graphRowsElement = this._itemsGraphsElement.createChild("div");
118 this._expandElements = this._itemsGraphsElement.createChild("div"); 118 this._expandElements = this._itemsGraphsElement.createChild("div");
119 this._expandElements.id = "orphan-expand-elements"; 119 this._expandElements.id = "orphan-expand-elements";
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 setSidebarSize: function(width) 208 setSidebarSize: function(width)
209 { 209 {
210 this._recordsView.setSidebarSize(width); 210 this._recordsView.setSidebarSize(width);
211 }, 211 },
212 212
213 /** 213 /**
214 * @param {!WebInspector.Event} event 214 * @param {!WebInspector.Event} event
215 */ 215 */
216 _sidebarResized: function(event) 216 _sidebarResized: function(event)
217 { 217 {
218 this.dispatchEventToListeners(WebInspector.SplitView.Events.SidebarSizeC hanged, event.data); 218 this.dispatchEventToListeners(WebInspector.SplitWidget.Events.SidebarSiz eChanged, event.data);
219 }, 219 },
220 220
221 _onViewportResize: function() 221 _onViewportResize: function()
222 { 222 {
223 this._resize(this._recordsView.sidebarSize()); 223 this._resize(this._recordsView.sidebarSize());
224 }, 224 },
225 225
226 /** 226 /**
227 * @param {number} sidebarWidth 227 * @param {number} sidebarWidth
228 */ 228 */
(...skipping 14 matching lines...) Expand all
243 this._adjustScrollPosition(0); 243 this._adjustScrollPosition(0);
244 this._linkifier.reset(); 244 this._linkifier.reset();
245 this._closeRecordDetails(); 245 this._closeRecordDetails();
246 this._automaticallySizeWindow = true; 246 this._automaticallySizeWindow = true;
247 this._presentationModel.reset(); 247 this._presentationModel.reset();
248 }, 248 },
249 249
250 250
251 /** 251 /**
252 * @override 252 * @override
253 * @return {!WebInspector.View} 253 * @return {!WebInspector.Widget}
254 */ 254 */
255 view: function() 255 view: function()
256 { 256 {
257 return this; 257 return this;
258 }, 258 },
259 259
260 /** 260 /**
261 * @override 261 * @override
262 */ 262 */
263 dispose: function() 263 dispose: function()
(...skipping 25 matching lines...) Expand all
289 refreshRecords: function(textFilter) 289 refreshRecords: function(textFilter)
290 { 290 {
291 this._automaticallySizeWindow = false; 291 this._automaticallySizeWindow = false;
292 this._presentationModel.setTextFilter(textFilter); 292 this._presentationModel.setTextFilter(textFilter);
293 this._invalidateAndScheduleRefresh(false, true); 293 this._invalidateAndScheduleRefresh(false, true);
294 }, 294 },
295 295
296 willHide: function() 296 willHide: function()
297 { 297 {
298 this._closeRecordDetails(); 298 this._closeRecordDetails();
299 WebInspector.View.prototype.willHide.call(this); 299 WebInspector.Widget.prototype.willHide.call(this);
300 }, 300 },
301 301
302 _onScroll: function(event) 302 _onScroll: function(event)
303 { 303 {
304 this._closeRecordDetails(); 304 this._closeRecordDetails();
305 this._scrollTop = this._containerElement.scrollTop; 305 this._scrollTop = this._containerElement.scrollTop;
306 this._headerElement.style.top = this._scrollTop + "px"; 306 this._headerElement.style.top = this._scrollTop + "px";
307 this._scheduleRefresh(true, true); 307 this._scheduleRefresh(true, true);
308 }, 308 },
309 309
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
1300 } else { 1300 } else {
1301 this._element.classList.add("hidden"); 1301 this._element.classList.add("hidden");
1302 } 1302 }
1303 }, 1303 },
1304 1304
1305 _dispose: function() 1305 _dispose: function()
1306 { 1306 {
1307 this._element.remove(); 1307 this._element.remove();
1308 } 1308 }
1309 } 1309 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/TimelinePanel.js ('k') | Source/devtools/front_end/ui/ColorSwatch.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698