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

Side by Side Diff: Source/devtools/front_end/timeline/TimelinePanel.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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 this._overviewPane.addEventListener(WebInspector.TimelineOverviewPane.Events .WindowChanged, this._onWindowChanged.bind(this)); 84 this._overviewPane.addEventListener(WebInspector.TimelineOverviewPane.Events .WindowChanged, this._onWindowChanged.bind(this));
85 this._overviewPane.show(topPaneElement); 85 this._overviewPane.show(topPaneElement);
86 86
87 this._createFileSelector(); 87 this._createFileSelector();
88 this._registerShortcuts(); 88 this._registerShortcuts();
89 89
90 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event s.WillReloadPage, this._willReloadPage, this); 90 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event s.WillReloadPage, this._willReloadPage, this);
91 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event s.Load, this._loadEventFired, this); 91 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event s.Load, this._loadEventFired, this);
92 92
93 // Create top level properties splitter. 93 // Create top level properties splitter.
94 this._detailsSplitView = new WebInspector.SplitView(false, true, "timelinePa nelDetailsSplitViewState"); 94 this._detailsSplitWidget = new WebInspector.SplitWidget(false, true, "timeli nePanelDetailsSplitViewState");
95 this._detailsSplitView.element.classList.add("timeline-details-split"); 95 this._detailsSplitWidget.element.classList.add("timeline-details-split");
96 this._detailsView = new WebInspector.TimelineDetailsView(this._model); 96 this._detailsView = new WebInspector.TimelineDetailsView(this._model);
97 this._detailsSplitView.installResizer(this._detailsView.headerElement()); 97 this._detailsSplitWidget.installResizer(this._detailsView.headerElement());
98 this._detailsSplitView.setSidebarView(this._detailsView); 98 this._detailsSplitWidget.setSidebarWidget(this._detailsView);
99 99
100 this._searchableView = new WebInspector.SearchableView(this); 100 this._searchableView = new WebInspector.SearchableView(this);
101 this._searchableView.setMinimumSize(0, 25); 101 this._searchableView.setMinimumSize(0, 25);
102 this._searchableView.element.classList.add("searchable-view"); 102 this._searchableView.element.classList.add("searchable-view");
103 this._detailsSplitView.setMainView(this._searchableView); 103 this._detailsSplitWidget.setMainWidget(this._searchableView);
104 104
105 this._stackView = new WebInspector.StackView(false); 105 this._stackView = new WebInspector.StackView(false);
106 this._stackView.show(this._searchableView.element); 106 this._stackView.show(this._searchableView.element);
107 this._stackView.element.classList.add("timeline-view-stack"); 107 this._stackView.element.classList.add("timeline-view-stack");
108 108
109 this._flameChartEnabledSetting.addChangeListener(this._onModeChanged, this); 109 this._flameChartEnabledSetting.addChangeListener(this._onModeChanged, this);
110 this._onModeChanged(); 110 this._onModeChanged();
111 this._detailsSplitView.show(this.element); 111 this._detailsSplitWidget.show(this.element);
112 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event s.SuspendStateChanged, this._onSuspendStateChanged, this); 112 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event s.SuspendStateChanged, this._onSuspendStateChanged, this);
113 } 113 }
114 114
115 WebInspector.TimelinePanel.OverviewMode = { 115 WebInspector.TimelinePanel.OverviewMode = {
116 Events: "Events", 116 Events: "Events",
117 Frames: "Frames" 117 Frames: "Frames"
118 }; 118 };
119 119
120 /** 120 /**
121 * @enum {string} 121 * @enum {string}
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 { 233 {
234 if (!this._lazyFrameModel) { 234 if (!this._lazyFrameModel) {
235 var tracingFrameModel = new WebInspector.TracingTimelineFrameModel() ; 235 var tracingFrameModel = new WebInspector.TracingTimelineFrameModel() ;
236 tracingFrameModel.addTraceEvents(this._model.target(), this._model.i nspectedTargetEvents(), this._tracingModel.sessionId() || ""); 236 tracingFrameModel.addTraceEvents(this._model.target(), this._model.i nspectedTargetEvents(), this._tracingModel.sessionId() || "");
237 this._lazyFrameModel = tracingFrameModel; 237 this._lazyFrameModel = tracingFrameModel;
238 } 238 }
239 return this._lazyFrameModel; 239 return this._lazyFrameModel;
240 }, 240 },
241 241
242 /** 242 /**
243 * @return {!WebInspector.View} 243 * @return {!WebInspector.Widget}
244 */ 244 */
245 _layersView: function() 245 _layersView: function()
246 { 246 {
247 if (this._lazyLayersView) 247 if (this._lazyLayersView)
248 return this._lazyLayersView; 248 return this._lazyLayersView;
249 this._lazyLayersView = new WebInspector.TimelineLayersView(); 249 this._lazyLayersView = new WebInspector.TimelineLayersView();
250 this._lazyLayersView.setTimelineModelAndDelegate(this._model, this); 250 this._lazyLayersView.setTimelineModelAndDelegate(this._model, this);
251 return this._lazyLayersView; 251 return this._lazyLayersView;
252 }, 252 },
253 253
254 _paintProfilerView: function() 254 _paintProfilerView: function()
255 { 255 {
256 if (this._lazyPaintProfilerView) 256 if (this._lazyPaintProfilerView)
257 return this._lazyPaintProfilerView; 257 return this._lazyPaintProfilerView;
258 this._lazyPaintProfilerView = new WebInspector.TimelinePaintProfilerView (/** @type {!WebInspector.TracingTimelineFrameModel} */(this._frameModel())); 258 this._lazyPaintProfilerView = new WebInspector.TimelinePaintProfilerView (/** @type {!WebInspector.TracingTimelineFrameModel} */(this._frameModel()));
259 return this._lazyPaintProfilerView; 259 return this._lazyPaintProfilerView;
260 }, 260 },
261 261
262 /** 262 /**
263 * @param {!WebInspector.TimelineModeView} modeView 263 * @param {!WebInspector.TimelineModeView} modeView
264 */ 264 */
265 _addModeView: function(modeView) 265 _addModeView: function(modeView)
266 { 266 {
267 modeView.setWindowTimes(this.windowStartTime(), this.windowEndTime()); 267 modeView.setWindowTimes(this.windowStartTime(), this.windowEndTime());
268 modeView.refreshRecords(this._textFilter._regex); 268 modeView.refreshRecords(this._textFilter._regex);
269 this._stackView.appendView(modeView.view(), "timelinePanelTimelineStackS plitViewState"); 269 this._stackView.appendView(modeView.view(), "timelinePanelTimelineStackS plitViewState");
270 modeView.view().addEventListener(WebInspector.SplitView.Events.SidebarSi zeChanged, this._sidebarResized, this); 270 modeView.view().addEventListener(WebInspector.SplitWidget.Events.Sidebar SizeChanged, this._sidebarResized, this);
271 this._currentViews.push(modeView); 271 this._currentViews.push(modeView);
272 }, 272 },
273 273
274 _removeAllModeViews: function() 274 _removeAllModeViews: function()
275 { 275 {
276 for (var i = 0; i < this._currentViews.length; ++i) { 276 for (var i = 0; i < this._currentViews.length; ++i) {
277 this._currentViews[i].removeEventListener(WebInspector.SplitView.Eve nts.SidebarSizeChanged, this._sidebarResized, this); 277 this._currentViews[i].removeEventListener(WebInspector.SplitWidget.E vents.SidebarSizeChanged, this._sidebarResized, this);
278 this._currentViews[i].dispose(); 278 this._currentViews[i].dispose();
279 } 279 }
280 this._currentViews = []; 280 this._currentViews = [];
281 this._stackView.detachChildViews(); 281 this._stackView.detachChildWidgets();
282 }, 282 },
283 283
284 /** 284 /**
285 * @param {string} name 285 * @param {string} name
286 * @param {!WebInspector.Setting} setting 286 * @param {!WebInspector.Setting} setting
287 * @param {string} tooltip 287 * @param {string} tooltip
288 * @return {!WebInspector.ToolbarItem} 288 * @return {!WebInspector.ToolbarItem}
289 */ 289 */
290 _createSettingCheckbox: function(name, setting, tooltip) 290 _createSettingCheckbox: function(name, setting, tooltip)
291 { 291 {
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 /** 1271 /**
1272 * @constructor 1272 * @constructor
1273 * @extends {WebInspector.TabbedPane} 1273 * @extends {WebInspector.TabbedPane}
1274 * @param {!WebInspector.TimelineModel} timelineModel 1274 * @param {!WebInspector.TimelineModel} timelineModel
1275 */ 1275 */
1276 WebInspector.TimelineDetailsView = function(timelineModel) 1276 WebInspector.TimelineDetailsView = function(timelineModel)
1277 { 1277 {
1278 WebInspector.TabbedPane.call(this); 1278 WebInspector.TabbedPane.call(this);
1279 this.element.classList.add("timeline-details"); 1279 this.element.classList.add("timeline-details");
1280 1280
1281 this._defaultDetailsView = new WebInspector.VBox(); 1281 this._defaultDetailsWidget = new WebInspector.VBox();
1282 this._defaultDetailsView.element.classList.add("timeline-details-view"); 1282 this._defaultDetailsWidget.element.classList.add("timeline-details-view");
1283 this._defaultDetailsContentElement = this._defaultDetailsView.element.create Child("div", "timeline-details-view-body vbox"); 1283 this._defaultDetailsContentElement = this._defaultDetailsWidget.element.crea teChild("div", "timeline-details-view-body vbox");
1284 this.appendTab(WebInspector.TimelinePanel.DetailsTab.Details, WebInspector.U IString("Summary"), this._defaultDetailsView); 1284 this.appendTab(WebInspector.TimelinePanel.DetailsTab.Details, WebInspector.U IString("Summary"), this._defaultDetailsWidget);
1285 this.setPreferredTab(WebInspector.TimelinePanel.DetailsTab.Details); 1285 this.setPreferredTab(WebInspector.TimelinePanel.DetailsTab.Details);
1286 1286
1287 if (Runtime.experiments.isEnabled("timelineDetailsChart")) { 1287 if (Runtime.experiments.isEnabled("timelineDetailsChart")) {
1288 this._heavyChartView = new WebInspector.TimelineDetailsView.BottomUpChar tView(timelineModel); 1288 this._heavyChartView = new WebInspector.TimelineDetailsView.BottomUpChar tView(timelineModel);
1289 this.appendTab(WebInspector.TimelinePanel.DetailsTab.BottomUpChart, WebI nspector.UIString("Costly Functions"), this._heavyChartView); 1289 this.appendTab(WebInspector.TimelinePanel.DetailsTab.BottomUpChart, WebI nspector.UIString("Costly Functions"), this._heavyChartView);
1290 } 1290 }
1291 1291
1292 this._staticTabs = [ 1292 this._staticTabs = [
1293 WebInspector.TimelinePanel.DetailsTab.Details, 1293 WebInspector.TimelinePanel.DetailsTab.Details,
1294 WebInspector.TimelinePanel.DetailsTab.BottomUpChart 1294 WebInspector.TimelinePanel.DetailsTab.BottomUpChart
(...skipping 25 matching lines...) Expand all
1320 { 1320 {
1321 this._selection = selection; 1321 this._selection = selection;
1322 if (this.selectedTabId === WebInspector.TimelinePanel.DetailsTab.BottomU pChart && this._heavyChartView) 1322 if (this.selectedTabId === WebInspector.TimelinePanel.DetailsTab.BottomU pChart && this._heavyChartView)
1323 this._heavyChartView.updateContents(selection); 1323 this._heavyChartView.updateContents(selection);
1324 }, 1324 },
1325 1325
1326 /** 1326 /**
1327 * @override 1327 * @override
1328 * @param {string} id 1328 * @param {string} id
1329 * @param {string} tabTitle 1329 * @param {string} tabTitle
1330 * @param {!WebInspector.View} view 1330 * @param {!WebInspector.Widget} view
1331 * @param {string=} tabTooltip 1331 * @param {string=} tabTooltip
1332 * @param {boolean=} userGesture 1332 * @param {boolean=} userGesture
1333 * @param {boolean=} isCloseable 1333 * @param {boolean=} isCloseable
1334 */ 1334 */
1335 appendTab: function(id, tabTitle, view, tabTooltip, userGesture, isCloseable ) 1335 appendTab: function(id, tabTitle, view, tabTooltip, userGesture, isCloseable )
1336 { 1336 {
1337 WebInspector.TabbedPane.prototype.appendTab.call(this, id, tabTitle, vie w, tabTooltip, userGesture, isCloseable); 1337 WebInspector.TabbedPane.prototype.appendTab.call(this, id, tabTitle, vie w, tabTooltip, userGesture, isCloseable);
1338 if (this._preferredTabId !== this.selectedTabId) 1338 if (this._preferredTabId !== this.selectedTabId)
1339 this.selectTab(id); 1339 this.selectTab(id);
1340 }, 1340 },
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1528 /** 1528 /**
1529 * @interface 1529 * @interface
1530 * @extends {WebInspector.EventTarget} 1530 * @extends {WebInspector.EventTarget}
1531 */ 1531 */
1532 WebInspector.TimelineModeView = function() 1532 WebInspector.TimelineModeView = function()
1533 { 1533 {
1534 } 1534 }
1535 1535
1536 WebInspector.TimelineModeView.prototype = { 1536 WebInspector.TimelineModeView.prototype = {
1537 /** 1537 /**
1538 * @return {!WebInspector.View} 1538 * @return {!WebInspector.Widget}
1539 */ 1539 */
1540 view: function() {}, 1540 view: function() {},
1541 1541
1542 dispose: function() {}, 1542 dispose: function() {},
1543 1543
1544 reset: function() {}, 1544 reset: function() {},
1545 1545
1546 /** 1546 /**
1547 * @param {?RegExp} textFilter 1547 * @param {?RegExp} textFilter
1548 */ 1548 */
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
1775 * @override 1775 * @override
1776 * @param {string} value 1776 * @param {string} value
1777 */ 1777 */
1778 handleQueryParam: function(value) 1778 handleQueryParam: function(value)
1779 { 1779 {
1780 WebInspector.TimelinePanel.show(); 1780 WebInspector.TimelinePanel.show();
1781 WebInspector.TimelinePanel.instance()._loadFromURL(value); 1781 WebInspector.TimelinePanel.instance()._loadFromURL(value);
1782 } 1782 }
1783 } 1783 }
1784 1784
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/TimelinePaintProfilerView.js ('k') | Source/devtools/front_end/timeline/TimelineView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698