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

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

Issue 423433004: DevTools: move the "Capture *" checkboxes from timeline sidebar to the toolbar. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 this._model.addFilter(this._durationFilter); 106 this._model.addFilter(this._durationFilter);
107 this._model.addFilter(this._textFilter); 107 this._model.addFilter(this._textFilter);
108 108
109 /** @type {!Array.<!WebInspector.TimelineModeView>} */ 109 /** @type {!Array.<!WebInspector.TimelineModeView>} */
110 this._currentViews = []; 110 this._currentViews = [];
111 111
112 this._overviewModeSetting = WebInspector.settings.createSetting("timelineOve rviewMode", WebInspector.TimelinePanel.OverviewMode.Events); 112 this._overviewModeSetting = WebInspector.settings.createSetting("timelineOve rviewMode", WebInspector.TimelinePanel.OverviewMode.Events);
113 this._flameChartEnabledSetting = WebInspector.settings.createSetting("timeli neFlameChartEnabled", false); 113 this._flameChartEnabledSetting = WebInspector.settings.createSetting("timeli neFlameChartEnabled", false);
114 this._createStatusBarItems(); 114 this._createStatusBarItems();
115 115
116 this._topPane = new WebInspector.SplitView(true, false); 116 var topPaneElement = this.element.createChild("div", "hbox");
117 this._topPane.element.id = "timeline-overview-panel"; 117 topPaneElement.id = "timeline-overview-panel";
118 this._topPane.show(this.element);
119 this._topPane.addEventListener(WebInspector.SplitView.Events.SidebarSizeChan ged, this._sidebarResized, this);
120 this._topPane.setResizable(false);
121 this._createRecordingOptions();
122 118
123 // Create top overview component. 119 // Create top overview component.
124 this._overviewPane = new WebInspector.TimelineOverviewPane(this._model, this ._uiUtils); 120 this._overviewPane = new WebInspector.TimelineOverviewPane(this._model, this ._uiUtils);
125 this._overviewPane.addEventListener(WebInspector.TimelineOverviewPane.Events .WindowChanged, this._onWindowChanged.bind(this)); 121 this._overviewPane.addEventListener(WebInspector.TimelineOverviewPane.Events .WindowChanged, this._onWindowChanged.bind(this));
126 this._overviewPane.show(this._topPane.mainElement()); 122 this._overviewPane.show(topPaneElement);
127 123
128 this._createFileSelector(); 124 this._createFileSelector();
129 this._registerShortcuts(); 125 this._registerShortcuts();
130 126
131 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod el.EventTypes.WillReloadPage, this._willReloadPage, this); 127 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod el.EventTypes.WillReloadPage, this._willReloadPage, this);
132 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod el.EventTypes.Load, this._loadEventFired, this); 128 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod el.EventTypes.Load, this._loadEventFired, this);
133 129
134 // Create top level properties splitter. 130 // Create top level properties splitter.
135 this._detailsSplitView = new WebInspector.SplitView(false, true, "timelinePa nelDetailsSplitViewState"); 131 this._detailsSplitView = new WebInspector.SplitView(false, true, "timelinePa nelDetailsSplitViewState");
136 this._detailsSplitView.element.classList.add("timeline-details-split"); 132 this._detailsSplitView.element.classList.add("timeline-details-split");
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 return this._windowEndTime; 230 return this._windowEndTime;
235 return this._model.maximumRecordTime() || Infinity; 231 return this._model.maximumRecordTime() || Infinity;
236 }, 232 },
237 233
238 /** 234 /**
239 * @param {!WebInspector.Event} event 235 * @param {!WebInspector.Event} event
240 */ 236 */
241 _sidebarResized: function(event) 237 _sidebarResized: function(event)
242 { 238 {
243 var width = /** @type {number} */ (event.data); 239 var width = /** @type {number} */ (event.data);
244 this._topPane.setSidebarSize(width);
245 for (var i = 0; i < this._currentViews.length; ++i) 240 for (var i = 0; i < this._currentViews.length; ++i)
246 this._currentViews[i].setSidebarSize(width); 241 this._currentViews[i].setSidebarSize(width);
247 }, 242 },
248 243
249 /** 244 /**
250 * @param {!WebInspector.Event} event 245 * @param {!WebInspector.Event} event
251 */ 246 */
252 _onWindowChanged: function(event) 247 _onWindowChanged: function(event)
253 { 248 {
254 this._windowStartTime = event.data.startTime; 249 this._windowStartTime = event.data.startTime;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 return this._lazyPaintProfilerView; 312 return this._lazyPaintProfilerView;
318 }, 313 },
319 314
320 /** 315 /**
321 * @param {!WebInspector.TimelineModeView} modeView 316 * @param {!WebInspector.TimelineModeView} modeView
322 */ 317 */
323 _addModeView: function(modeView) 318 _addModeView: function(modeView)
324 { 319 {
325 modeView.setWindowTimes(this.windowStartTime(), this.windowEndTime()); 320 modeView.setWindowTimes(this.windowStartTime(), this.windowEndTime());
326 modeView.refreshRecords(this._textFilter._regex); 321 modeView.refreshRecords(this._textFilter._regex);
327 modeView.view().setSidebarSize(this._topPane.sidebarSize());
328 this._stackView.appendView(modeView.view(), "timelinePanelTimelineStackS plitViewState"); 322 this._stackView.appendView(modeView.view(), "timelinePanelTimelineStackS plitViewState");
329 modeView.view().addEventListener(WebInspector.SplitView.Events.SidebarSi zeChanged, this._sidebarResized, this); 323 modeView.view().addEventListener(WebInspector.SplitView.Events.SidebarSi zeChanged, this._sidebarResized, this);
330 this._currentViews.push(modeView); 324 this._currentViews.push(modeView);
331 }, 325 },
332 326
333 _removeAllModeViews: function() 327 _removeAllModeViews: function()
334 { 328 {
335 for (var i = 0; i < this._currentViews.length; ++i) { 329 for (var i = 0; i < this._currentViews.length; ++i) {
336 this._currentViews[i].removeEventListener(WebInspector.SplitView.Eve nts.SidebarSizeChanged, this._sidebarResized, this); 330 this._currentViews[i].removeEventListener(WebInspector.SplitView.Eve nts.SidebarSizeChanged, this._sidebarResized, this);
337 this._currentViews[i].dispose(); 331 this._currentViews[i].dispose();
(...skipping 12 matching lines...) Expand all
350 { 344 {
351 if (!this._recordingOptionUIControls) 345 if (!this._recordingOptionUIControls)
352 this._recordingOptionUIControls = []; 346 this._recordingOptionUIControls = [];
353 347
354 var checkboxElement = document.createElement("input"); 348 var checkboxElement = document.createElement("input");
355 var labelElement = WebInspector.SettingsUI.createSettingCheckbox(name, s etting, true, checkboxElement, tooltip); 349 var labelElement = WebInspector.SettingsUI.createSettingCheckbox(name, s etting, true, checkboxElement, tooltip);
356 this._recordingOptionUIControls.push({ "label": labelElement, "checkbox" : checkboxElement }); 350 this._recordingOptionUIControls.push({ "label": labelElement, "checkbox" : checkboxElement });
357 return labelElement; 351 return labelElement;
358 }, 352 },
359 353
360 _createRecordingOptions: function()
361 {
362 var topPaneSidebarElement = this._topPane.sidebarElement();
363 this._captureStacksSetting = WebInspector.settings.createSetting("timeli neCaptureStacks", true);
364 topPaneSidebarElement.appendChild(this._createSettingCheckbox(WebInspect or.UIString("Capture stacks"),
365 this._capt ureStacksSetting,
366 WebInspect or.UIString("Capture JavaScript stack on every timeline event")));
367
368 this._captureMemorySetting = WebInspector.settings.createSetting("timeli neCaptureMemory", false);
369 topPaneSidebarElement.appendChild(this._createSettingCheckbox(WebInspect or.UIString("Capture memory"),
370 this._capt ureMemorySetting,
371 WebInspect or.UIString("Capture memory information on every timeline event")));
372 this._captureMemorySetting.addChangeListener(this._onModeChanged, this);
373
374 if (WebInspector.experimentsSettings.timelinePowerProfiler.isEnabled()) {
375 this._capturePowerSetting = WebInspector.settings.createSetting("tim elineCapturePower", false);
376 topPaneSidebarElement.appendChild(this._createSettingCheckbox(WebIns pector.UIString("Capture power"),
377 this._ capturePowerSetting,
378 WebIns pector.UIString("Capture power information")));
379 this._capturePowerSetting.addChangeListener(this._onModeChanged, thi s);
380 }
381
382 if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled()) {
383 this._captureLayersAndPicturesSetting = WebInspector.settings.create Setting("timelineCaptureLayersAndPictures", false);
384 topPaneSidebarElement.appendChild(this._createSettingCheckbox(WebIns pector.UIString("Capture pictures"),
385 this._ captureLayersAndPicturesSetting,
386 WebIns pector.UIString("Capture graphics layer positions and painted pictures")));
387 }
388 },
389
390 _createStatusBarItems: function() 354 _createStatusBarItems: function()
391 { 355 {
392 var panelStatusBarElement = this.element.createChild("div", "panel-statu s-bar"); 356 var panelStatusBarElement = this.element.createChild("div", "panel-statu s-bar");
393 this._statusBarButtons = /** @type {!Array.<!WebInspector.StatusBarItem> } */ ([]); 357 this._statusBarButtons = /** @type {!Array.<!WebInspector.StatusBarItem> } */ ([]);
394 358
395 this.toggleTimelineButton = new WebInspector.StatusBarButton("", "record -profile-status-bar-item"); 359 this.toggleTimelineButton = new WebInspector.StatusBarButton("", "record -profile-status-bar-item");
396 this.toggleTimelineButton.addEventListener("click", this._toggleTimeline ButtonClicked, this); 360 this.toggleTimelineButton.addEventListener("click", this._toggleTimeline ButtonClicked, this);
397 this._statusBarButtons.push(this.toggleTimelineButton); 361 this._statusBarButtons.push(this.toggleTimelineButton);
398 panelStatusBarElement.appendChild(this.toggleTimelineButton.element); 362 panelStatusBarElement.appendChild(this.toggleTimelineButton.element);
399 this._updateToggleTimelineButton(false); 363 this._updateToggleTimelineButton(false);
(...skipping 18 matching lines...) Expand all
418 panelStatusBarElement.appendChild(framesToggleButton.element); 382 panelStatusBarElement.appendChild(framesToggleButton.element);
419 383
420 if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled()) { 384 if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled()) {
421 var flameChartToggleButton = new WebInspector.StatusBarButton(WebIns pector.UIString("Tracing mode"), "timeline-flame-chart-status-bar-item"); 385 var flameChartToggleButton = new WebInspector.StatusBarButton(WebIns pector.UIString("Tracing mode"), "timeline-flame-chart-status-bar-item");
422 flameChartToggleButton.toggled = this._flameChartEnabledSetting.get( ); 386 flameChartToggleButton.toggled = this._flameChartEnabledSetting.get( );
423 flameChartToggleButton.addEventListener("click", this._flameChartEna bledChanged.bind(this, flameChartToggleButton)); 387 flameChartToggleButton.addEventListener("click", this._flameChartEna bledChanged.bind(this, flameChartToggleButton));
424 this._statusBarButtons.push(flameChartToggleButton); 388 this._statusBarButtons.push(flameChartToggleButton);
425 panelStatusBarElement.appendChild(flameChartToggleButton.element); 389 panelStatusBarElement.appendChild(flameChartToggleButton.element);
426 } 390 }
427 391
392 this._captureStacksSetting = WebInspector.settings.createSetting("timeli neCaptureStacks", true);
393 panelStatusBarElement.appendChild(this._createSettingCheckbox(WebInspect or.UIString("Stacks"),
394 this._capt ureStacksSetting,
395 WebInspect or.UIString("Capture JavaScript stack on every timeline event")));
396 this._captureMemorySetting = WebInspector.settings.createSetting("timeli neCaptureMemory", false);
397 panelStatusBarElement.appendChild(this._createSettingCheckbox(WebInspect or.UIString("Memory"),
398 this._capt ureMemorySetting,
399 WebInspect or.UIString("Capture memory information on every timeline event")));
400 this._captureMemorySetting.addChangeListener(this._onModeChanged, this);
401 if (WebInspector.experimentsSettings.timelinePowerProfiler.isEnabled()) {
402 this._capturePowerSetting = WebInspector.settings.createSetting("tim elineCapturePower", false);
403 panelStatusBarElement.appendChild(this._createSettingCheckbox(WebIns pector.UIString("Power"),
404 this._ capturePowerSetting,
405 WebIns pector.UIString("Capture power information")));
406 this._capturePowerSetting.addChangeListener(this._onModeChanged, thi s);
407 }
408 if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled()) {
409 this._captureLayersAndPicturesSetting = WebInspector.settings.create Setting("timelineCaptureLayersAndPictures", false);
410 panelStatusBarElement.appendChild(this._createSettingCheckbox(WebIns pector.UIString("Paint"),
411 this._ captureLayersAndPicturesSetting,
412 WebIns pector.UIString("Capture graphics layer positions and painted pictures")));
413 }
414
428 this._miscStatusBarItems = panelStatusBarElement.createChild("div", "sta tus-bar-item"); 415 this._miscStatusBarItems = panelStatusBarElement.createChild("div", "sta tus-bar-item");
429 416
430 this._filtersContainer = this.element.createChild("div", "timeline-filte rs-header hidden"); 417 this._filtersContainer = this.element.createChild("div", "timeline-filte rs-header hidden");
431 this._filtersContainer.appendChild(this._filterBar.filtersElement()); 418 this._filtersContainer.appendChild(this._filterBar.filtersElement());
432 this._filterBar.addEventListener(WebInspector.FilterBar.Events.FiltersTo ggled, this._onFiltersToggled, this); 419 this._filterBar.addEventListener(WebInspector.FilterBar.Events.FiltersTo ggled, this._onFiltersToggled, this);
433 this._filterBar.setName("timelinePanel"); 420 this._filterBar.setName("timelinePanel");
434 }, 421 },
435 422
436 /** 423 /**
437 * @return {!WebInspector.FilterBar} 424 * @return {!WebInspector.FilterBar}
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after
1481 * @param {!WebInspector.TimelineModel.Record} record 1468 * @param {!WebInspector.TimelineModel.Record} record
1482 * @return {boolean} 1469 * @return {boolean}
1483 */ 1470 */
1484 accept: function(record) 1471 accept: function(record)
1485 { 1472 {
1486 return !this._regex || this._uiUtils.testContentMatching(record, this._r egex); 1473 return !this._regex || this._uiUtils.testContentMatching(record, this._r egex);
1487 }, 1474 },
1488 1475
1489 __proto__: WebInspector.TimelineModel.Filter.prototype 1476 __proto__: WebInspector.TimelineModel.Filter.prototype
1490 } 1477 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698