| OLD | NEW |
| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 this._overviewPane = new UI.TimelineOverviewPane('timeline'); | 96 this._overviewPane = new UI.TimelineOverviewPane('timeline'); |
| 97 this._overviewPane.addEventListener(UI.TimelineOverviewPane.Events.WindowCha
nged, this._onWindowChanged.bind(this)); | 97 this._overviewPane.addEventListener(UI.TimelineOverviewPane.Events.WindowCha
nged, this._onWindowChanged.bind(this)); |
| 98 this._overviewPane.show(topPaneElement); | 98 this._overviewPane.show(topPaneElement); |
| 99 this._statusPaneContainer = this._timelinePane.element.createChild('div', 's
tatus-pane-container fill'); | 99 this._statusPaneContainer = this._timelinePane.element.createChild('div', 's
tatus-pane-container fill'); |
| 100 | 100 |
| 101 this._createFileSelector(); | 101 this._createFileSelector(); |
| 102 | 102 |
| 103 SDK.targetManager.addEventListener(SDK.TargetManager.Events.PageReloadReques
ted, this._pageReloadRequested, this); | 103 SDK.targetManager.addEventListener(SDK.TargetManager.Events.PageReloadReques
ted, this._pageReloadRequested, this); |
| 104 SDK.targetManager.addEventListener(SDK.TargetManager.Events.Load, this._load
EventFired, this); | 104 SDK.targetManager.addEventListener(SDK.TargetManager.Events.Load, this._load
EventFired, this); |
| 105 | 105 |
| 106 this._landingPage = new Timeline.TimelineLandingPage(); |
| 107 |
| 106 // Create top level properties splitter. | 108 // Create top level properties splitter. |
| 107 this._detailsSplitWidget = new UI.SplitWidget(false, true, 'timelinePanelDet
ailsSplitViewState'); | 109 this._detailsSplitWidget = new UI.SplitWidget(false, true, 'timelinePanelDet
ailsSplitViewState'); |
| 108 this._detailsSplitWidget.element.classList.add('timeline-details-split'); | 110 this._detailsSplitWidget.element.classList.add('timeline-details-split'); |
| 109 this._detailsView = new Timeline.TimelineDetailsView(this._model, this._filt
ers, this); | 111 this._detailsView = new Timeline.TimelineDetailsView(this._model, this._filt
ers, this); |
| 110 this._detailsSplitWidget.installResizer(this._detailsView.headerElement()); | 112 this._detailsSplitWidget.installResizer(this._detailsView.headerElement()); |
| 111 this._detailsSplitWidget.setSidebarWidget(this._detailsView); | 113 this._detailsSplitWidget.setSidebarWidget(this._detailsView); |
| 112 | 114 |
| 113 this._searchableView = new UI.SearchableView(this); | 115 this._searchableView = new UI.SearchableView(this); |
| 114 this._searchableView.setMinimumSize(0, 100); | 116 this._searchableView.setMinimumSize(0, 100); |
| 115 this._searchableView.element.classList.add('searchable-view'); | 117 this._searchableView.element.classList.add('searchable-view'); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 const checkboxItem = new UI.ToolbarCheckbox(name, tooltip, setting); | 300 const checkboxItem = new UI.ToolbarCheckbox(name, tooltip, setting); |
| 299 this._recordingOptionUIControls.push(checkboxItem); | 301 this._recordingOptionUIControls.push(checkboxItem); |
| 300 return checkboxItem; | 302 return checkboxItem; |
| 301 } | 303 } |
| 302 | 304 |
| 303 _recreateToolbarItems() { | 305 _recreateToolbarItems() { |
| 304 this._panelToolbar.removeToolbarItems(); | 306 this._panelToolbar.removeToolbarItems(); |
| 305 | 307 |
| 306 // Record | 308 // Record |
| 307 const newButton = new UI.ToolbarButton(Common.UIString('New recording'), 'la
rgeicon-add', Common.UIString('New')); | 309 const newButton = new UI.ToolbarButton(Common.UIString('New recording'), 'la
rgeicon-add', Common.UIString('New')); |
| 308 newButton.setEnabled(!this._landingPage); | 310 newButton.setEnabled(!this._model.isEmpty()); |
| 309 newButton.addEventListener(UI.ToolbarButton.Events.Click, this._clear, this)
; | 311 newButton.addEventListener(UI.ToolbarButton.Events.Click, this._clear, this)
; |
| 310 this._panelToolbar.appendToolbarItem(newButton); | 312 this._panelToolbar.appendToolbarItem(newButton); |
| 311 this._panelToolbar.appendSeparator(); | 313 this._panelToolbar.appendSeparator(); |
| 312 this._panelToolbar.appendToolbarItem(UI.Toolbar.createActionButton(this._tog
gleRecordAction)); | 314 this._panelToolbar.appendToolbarItem(UI.Toolbar.createActionButton(this._tog
gleRecordAction)); |
| 313 this._panelToolbar.appendToolbarItem(UI.Toolbar.createActionButtonForId('mai
n.reload')); | 315 this._panelToolbar.appendToolbarItem(UI.Toolbar.createActionButtonForId('mai
n.reload')); |
| 314 this._panelToolbar.appendSeparator(); | 316 this._panelToolbar.appendSeparator(); |
| 315 this._panelToolbar.appendToolbarItem(this._configureThrottlingButton); | 317 this._panelToolbar.appendToolbarItem(this._configureThrottlingButton); |
| 316 this._panelToolbar.appendToolbarItem(UI.Toolbar.createActionButtonForId('com
ponents.collect-garbage')); | 318 this._panelToolbar.appendToolbarItem(UI.Toolbar.createActionButtonForId('com
ponents.collect-garbage')); |
| 317 | 319 |
| 318 // Checkboxes | 320 // Checkboxes |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 if (!mainTarget) | 538 if (!mainTarget) |
| 537 return; | 539 return; |
| 538 this._setState(Timeline.TimelinePanel.State.StartPending); | 540 this._setState(Timeline.TimelinePanel.State.StartPending); |
| 539 this._showRecordingStarted(); | 541 this._showRecordingStarted(); |
| 540 | 542 |
| 541 this._sessionGeneration = Symbol('timelineSessionGeneration'); | 543 this._sessionGeneration = Symbol('timelineSessionGeneration'); |
| 542 this._autoRecordGeneration = userInitiated ? null : Symbol('Generation'); | 544 this._autoRecordGeneration = userInitiated ? null : Symbol('Generation'); |
| 543 var enabledTraceProviders = Extensions.extensionServer.traceProviders().filt
er( | 545 var enabledTraceProviders = Extensions.extensionServer.traceProviders().filt
er( |
| 544 provider => Timeline.TimelinePanel._settingForTraceProvider(provider).ge
t()); | 546 provider => Timeline.TimelinePanel._settingForTraceProvider(provider).ge
t()); |
| 545 | 547 |
| 546 var captureOptions = { | 548 const recordingOptions = this._landingPage.recordingOptions(); |
| 547 enableJSSampling: this._captureJSProfileSetting.get(), | |
| 548 capturePictures: this._captureLayersAndPicturesSetting.get(), | |
| 549 captureFilmStrip: this._captureFilmStripSetting.get() | |
| 550 }; | |
| 551 | |
| 552 this._controller = new Timeline.TimelineController(mainTarget, this, this._t
racingModel); | 549 this._controller = new Timeline.TimelineController(mainTarget, this, this._t
racingModel); |
| 553 this._controller.startRecording(captureOptions, enabledTraceProviders); | 550 this._controller.startRecording(recordingOptions, enabledTraceProviders); |
| 554 this._recordingStartTime = Date.now(); | 551 this._recordingStartTime = Date.now(); |
| 555 | 552 |
| 556 for (var i = 0; i < this._overviewControls.length; ++i) | 553 for (var i = 0; i < this._overviewControls.length; ++i) |
| 557 this._overviewControls[i].timelineStarted(); | 554 this._overviewControls[i].timelineStarted(); |
| 558 | 555 |
| 559 Host.userMetrics.actionTaken(Host.UserMetrics.Action.TimelineStarted); | 556 Host.userMetrics.actionTaken(Host.UserMetrics.Action.TimelineStarted); |
| 560 this._setUIControlsEnabled(false); | 557 this._setUIControlsEnabled(false); |
| 561 this._hideLandingPage(); | 558 this._hideLandingPage(); |
| 562 } | 559 } |
| 563 | 560 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 | 655 |
| 659 /** | 656 /** |
| 660 * @override | 657 * @override |
| 661 * @return {?symbol} | 658 * @return {?symbol} |
| 662 */ | 659 */ |
| 663 sessionGeneration() { | 660 sessionGeneration() { |
| 664 return this._sessionGeneration; | 661 return this._sessionGeneration; |
| 665 } | 662 } |
| 666 | 663 |
| 667 _showLandingPage() { | 664 _showLandingPage() { |
| 668 if (this._landingPage) | |
| 669 return; | |
| 670 this._timelinePane.detach(); | 665 this._timelinePane.detach(); |
| 671 this._landingPage = new Timeline.TimelineLandingPage(); | |
| 672 this._landingPage.show(this.element); | 666 this._landingPage.show(this.element); |
| 673 } | 667 } |
| 674 | 668 |
| 675 _hideLandingPage() { | 669 _hideLandingPage() { |
| 676 if (!this._landingPage) | |
| 677 return; | |
| 678 this._landingPage.detach(); | 670 this._landingPage.detach(); |
| 679 this._landingPage = null; | |
| 680 this._timelinePane.show(this.element); | 671 this._timelinePane.show(this.element); |
| 681 } | 672 } |
| 682 | 673 |
| 683 /** | 674 /** |
| 684 * @override | 675 * @override |
| 685 */ | 676 */ |
| 686 loadingStarted() { | 677 loadingStarted() { |
| 687 this._hideLandingPage(); | 678 this._hideLandingPage(); |
| 688 | 679 |
| 689 if (this._statusPane) | 680 if (this._statusPane) |
| (...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1928 } | 1919 } |
| 1929 | 1920 |
| 1930 /** | 1921 /** |
| 1931 * @override | 1922 * @override |
| 1932 * @param {!SDK.Target} target | 1923 * @param {!SDK.Target} target |
| 1933 */ | 1924 */ |
| 1934 targetRemoved(target) { | 1925 targetRemoved(target) { |
| 1935 this._targets.remove(target, true); | 1926 this._targets.remove(target, true); |
| 1936 } | 1927 } |
| 1937 }; | 1928 }; |
| OLD | NEW |