| 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 _createSettingCheckbox(setting, tooltip) { | 209 _createSettingCheckbox(setting, tooltip) { |
| 210 const checkboxItem = new UI.ToolbarSettingCheckbox(setting, tooltip); | 210 const checkboxItem = new UI.ToolbarSettingCheckbox(setting, tooltip); |
| 211 this._recordingOptionUIControls.push(checkboxItem); | 211 this._recordingOptionUIControls.push(checkboxItem); |
| 212 return checkboxItem; | 212 return checkboxItem; |
| 213 } | 213 } |
| 214 | 214 |
| 215 _populateToolbar() { | 215 _populateToolbar() { |
| 216 // Record | 216 // Record |
| 217 this._panelToolbar.appendToolbarItem(UI.Toolbar.createActionButton(this._tog
gleRecordAction)); | 217 this._panelToolbar.appendToolbarItem(UI.Toolbar.createActionButton(this._tog
gleRecordAction)); |
| 218 this._panelToolbar.appendToolbarItem(UI.Toolbar.createActionButtonForId('mai
n.reload')); | 218 this._panelToolbar.appendToolbarItem(UI.Toolbar.createActionButtonForId('mai
n.reload')); |
| 219 var clearButton = new UI.ToolbarButton(Common.UIString('Clear'), 'largeicon-
clear'); | 219 this._clearButton = new UI.ToolbarButton(Common.UIString('Clear'), 'largeico
n-clear'); |
| 220 clearButton.addEventListener(UI.ToolbarButton.Events.Click, () => this._clea
r()); | 220 this._clearButton.addEventListener(UI.ToolbarButton.Events.Click, () => this
._clear()); |
| 221 this._panelToolbar.appendToolbarItem(clearButton); | 221 this._panelToolbar.appendToolbarItem(this._clearButton); |
| 222 this._panelToolbar.appendSeparator(); | 222 this._panelToolbar.appendSeparator(); |
| 223 | 223 |
| 224 // View | 224 // View |
| 225 this._panelToolbar.appendSeparator(); | 225 this._panelToolbar.appendSeparator(); |
| 226 this._showScreenshotsToolbarCheckbox = | 226 this._showScreenshotsToolbarCheckbox = |
| 227 this._createSettingCheckbox(this._showScreenshotsSetting, Common.UIStrin
g('Capture screenshots')); | 227 this._createSettingCheckbox(this._showScreenshotsSetting, Common.UIStrin
g('Capture screenshots')); |
| 228 this._panelToolbar.appendToolbarItem(this._showScreenshotsToolbarCheckbox); | 228 this._panelToolbar.appendToolbarItem(this._showScreenshotsToolbarCheckbox); |
| 229 | 229 |
| 230 this._showMemoryToolbarCheckbox = | 230 this._showMemoryToolbarCheckbox = |
| 231 this._createSettingCheckbox(this._showMemorySetting, Common.UIString('Sh
ow memory timeline')); | 231 this._createSettingCheckbox(this._showMemorySetting, Common.UIString('Sh
ow memory timeline')); |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 } | 546 } |
| 547 | 547 |
| 548 _onSuspendStateChanged() { | 548 _onSuspendStateChanged() { |
| 549 this._updateTimelineControls(); | 549 this._updateTimelineControls(); |
| 550 } | 550 } |
| 551 | 551 |
| 552 _updateTimelineControls() { | 552 _updateTimelineControls() { |
| 553 var state = Timeline.TimelinePanel.State; | 553 var state = Timeline.TimelinePanel.State; |
| 554 this._toggleRecordAction.setToggled(this._state === state.Recording); | 554 this._toggleRecordAction.setToggled(this._state === state.Recording); |
| 555 this._toggleRecordAction.setEnabled(this._state === state.Recording || this.
_state === state.Idle); | 555 this._toggleRecordAction.setEnabled(this._state === state.Recording || this.
_state === state.Idle); |
| 556 this._clearButton.setEnabled(this._state === state.Idle); |
| 556 this._panelToolbar.setEnabled(this._state !== state.Loading); | 557 this._panelToolbar.setEnabled(this._state !== state.Loading); |
| 557 this._dropTarget.setEnabled(this._state === state.Idle); | 558 this._dropTarget.setEnabled(this._state === state.Idle); |
| 558 } | 559 } |
| 559 | 560 |
| 560 _toggleRecording() { | 561 _toggleRecording() { |
| 561 if (this._state === Timeline.TimelinePanel.State.Idle) { | 562 if (this._state === Timeline.TimelinePanel.State.Idle) { |
| 562 var tracingManagers = SDK.targetManager.models(SDK.TracingManager); | 563 var tracingManagers = SDK.targetManager.models(SDK.TracingManager); |
| 563 if (tracingManagers.length) | 564 if (tracingManagers.length) |
| 564 this._startRecording(tracingManagers[0], true); | 565 this._startRecording(tracingManagers[0], true); |
| 565 } else if (this._state === Timeline.TimelinePanel.State.Recording) { | 566 } else if (this._state === Timeline.TimelinePanel.State.Recording) { |
| (...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1300 return true; | 1301 return true; |
| 1301 case 'timeline.jump-to-next-frame': | 1302 case 'timeline.jump-to-next-frame': |
| 1302 panel._jumpToFrame(1); | 1303 panel._jumpToFrame(1); |
| 1303 return true; | 1304 return true; |
| 1304 } | 1305 } |
| 1305 return false; | 1306 return false; |
| 1306 } | 1307 } |
| 1307 }; | 1308 }; |
| 1308 | 1309 |
| 1309 Timeline.TimelinePanel._traceProviderSettingSymbol = Symbol('traceProviderSettin
g'); | 1310 Timeline.TimelinePanel._traceProviderSettingSymbol = Symbol('traceProviderSettin
g'); |
| OLD | NEW |