| 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 * @return {!WebInspector.TimelineFrameModel} | 225 * @return {!WebInspector.TimelineFrameModel} |
| 226 */ | 226 */ |
| 227 _frameModel: function() | 227 _frameModel: function() |
| 228 { | 228 { |
| 229 if (!this._lazyFrameModel) | 229 if (!this._lazyFrameModel) |
| 230 this._lazyFrameModel = new WebInspector.TimelineFrameModel(this._mod
el); | 230 this._lazyFrameModel = new WebInspector.TimelineFrameModel(this._mod
el); |
| 231 return this._lazyFrameModel; | 231 return this._lazyFrameModel; |
| 232 }, | 232 }, |
| 233 | 233 |
| 234 /** | 234 /** |
| 235 * @return {!WebInspector.TimelinePanel.Mode} | |
| 236 */ | |
| 237 _availableModes: function() | |
| 238 { | |
| 239 if (this._modes) | |
| 240 return this._modes; | |
| 241 | |
| 242 this._modes = { | |
| 243 Events: WebInspector.TimelinePanel.Mode.Events, | |
| 244 Frames: WebInspector.TimelinePanel.Mode.Frames, | |
| 245 Memory: WebInspector.TimelinePanel.Mode.Memory, | |
| 246 }; | |
| 247 | |
| 248 if (WebInspector.experimentsSettings.timelineFlameChart.isEnabled()) | |
| 249 this._modes.FlameChart = WebInspector.TimelinePanel.Mode.FlameChart; | |
| 250 | |
| 251 if (Capabilities.canProfilePower) | |
| 252 this._modes.Power = WebInspector.TimelinePanel.Mode.Power; | |
| 253 | |
| 254 return this._modes; | |
| 255 }, | |
| 256 | |
| 257 /** | |
| 258 * @return {!WebInspector.TimelineView} | 235 * @return {!WebInspector.TimelineView} |
| 259 */ | 236 */ |
| 260 _timelineView: function() | 237 _timelineView: function() |
| 261 { | 238 { |
| 262 if (!this._lazyTimelineView) | 239 if (!this._lazyTimelineView) |
| 263 this._lazyTimelineView = new WebInspector.TimelineView(this, this._m
odel); | 240 this._lazyTimelineView = new WebInspector.TimelineView(this, this._m
odel); |
| 264 return this._lazyTimelineView; | 241 return this._lazyTimelineView; |
| 265 }, | 242 }, |
| 266 | 243 |
| 267 /** | 244 /** |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 { | 287 { |
| 311 this._viewsMap = {}; | 288 this._viewsMap = {}; |
| 312 | 289 |
| 313 var topPaneSidebarElement = this._topPane.sidebarElement(); | 290 var topPaneSidebarElement = this._topPane.sidebarElement(); |
| 314 topPaneSidebarElement.id = "timeline-overview-sidebar"; | 291 topPaneSidebarElement.id = "timeline-overview-sidebar"; |
| 315 | 292 |
| 316 var overviewTreeElement = topPaneSidebarElement.createChild("ol", "sideb
ar-tree vbox"); | 293 var overviewTreeElement = topPaneSidebarElement.createChild("ol", "sideb
ar-tree vbox"); |
| 317 var topPaneSidebarTree = new TreeOutline(overviewTreeElement); | 294 var topPaneSidebarTree = new TreeOutline(overviewTreeElement); |
| 318 | 295 |
| 319 this._overviewItems = {}; | 296 this._overviewItems = {}; |
| 320 for (var mode in this._availableModes()) { | 297 for (var mode in WebInspector.TimelinePanel.Mode) { |
| 298 if (mode === WebInspector.TimelinePanel.Mode.FlameChart && !WebInspe
ctor.experimentsSettings.timelineFlameChart.isEnabled() || |
| 299 mode === WebInspector.TimelinePanel.Mode.Power && !Capabilities.
canProfilePower) |
| 300 continue; |
| 321 this._overviewItems[mode] = new WebInspector.SidebarTreeElement("tim
eline-overview-sidebar-" + mode.toLowerCase(), WebInspector.UIString(mode)); | 301 this._overviewItems[mode] = new WebInspector.SidebarTreeElement("tim
eline-overview-sidebar-" + mode.toLowerCase(), WebInspector.UIString(mode)); |
| 322 var item = this._overviewItems[mode]; | 302 var item = this._overviewItems[mode]; |
| 323 item.onselect = this._onModeChanged.bind(this, mode); | 303 item.onselect = this._onModeChanged.bind(this, mode); |
| 324 topPaneSidebarTree.appendChild(item); | 304 topPaneSidebarTree.appendChild(item); |
| 325 } | 305 } |
| 326 }, | 306 }, |
| 327 | 307 |
| 328 _createStatusBarItems: function() | 308 _createStatusBarItems: function() |
| 329 { | 309 { |
| 330 var panelStatusBarElement = this.element.createChild("div", "panel-statu
s-bar"); | 310 var panelStatusBarElement = this.element.createChild("div", "panel-statu
s-bar"); |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 this._updateSelectionDetails(); | 551 this._updateSelectionDetails(); |
| 572 }, | 552 }, |
| 573 | 553 |
| 574 /** | 554 /** |
| 575 * @param {boolean} userInitiated | 555 * @param {boolean} userInitiated |
| 576 */ | 556 */ |
| 577 _startRecording: function(userInitiated) | 557 _startRecording: function(userInitiated) |
| 578 { | 558 { |
| 579 this._userInitiatedRecording = userInitiated; | 559 this._userInitiatedRecording = userInitiated; |
| 580 this._model.startRecording(); | 560 this._model.startRecording(); |
| 581 for (var mode in this._availableModes()) | 561 for (var mode in WebInspector.TimelinePanel.Mode) |
| 582 this._viewsForMode(mode).overviewView.timelineStarted(); | 562 this._viewsForMode(mode).overviewView.timelineStarted(); |
| 583 | 563 |
| 584 if (userInitiated) | 564 if (userInitiated) |
| 585 WebInspector.userMetrics.TimelineStarted.record(); | 565 WebInspector.userMetrics.TimelineStarted.record(); |
| 586 }, | 566 }, |
| 587 | 567 |
| 588 _stopRecording: function() | 568 _stopRecording: function() |
| 589 { | 569 { |
| 590 this._userInitiatedRecording = false; | 570 this._userInitiatedRecording = false; |
| 591 this._model.stopRecording(); | 571 this._model.stopRecording(); |
| 592 for (var mode in this._availableModes()) | 572 for (var mode in WebInspector.TimelinePanel.Mode) |
| 593 this._viewsForMode(mode).overviewView.timelineStopped(); | 573 this._viewsForMode(mode).overviewView.timelineStopped(); |
| 594 }, | 574 }, |
| 595 | 575 |
| 596 /** | 576 /** |
| 597 * @return {boolean} | 577 * @return {boolean} |
| 598 */ | 578 */ |
| 599 _toggleTimelineButtonClicked: function() | 579 _toggleTimelineButtonClicked: function() |
| 600 { | 580 { |
| 601 if (this._operationInProgress) | 581 if (this._operationInProgress) |
| 602 return true; | 582 return true; |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1167 * @param {!WebInspector.TimelineModel.Record} record | 1147 * @param {!WebInspector.TimelineModel.Record} record |
| 1168 * @return {boolean} | 1148 * @return {boolean} |
| 1169 */ | 1149 */ |
| 1170 accept: function(record) | 1150 accept: function(record) |
| 1171 { | 1151 { |
| 1172 return !this._hiddenRecords[record.type]; | 1152 return !this._hiddenRecords[record.type]; |
| 1173 }, | 1153 }, |
| 1174 | 1154 |
| 1175 __proto__: WebInspector.TimelineModel.Filter.prototype | 1155 __proto__: WebInspector.TimelineModel.Filter.prototype |
| 1176 } | 1156 } |
| OLD | NEW |