OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1385 * @param {!WebInspector.TimelineModel} timelineModel | 1385 * @param {!WebInspector.TimelineModel} timelineModel |
1386 * @param {!WebInspector.TimelineFrameModelBase} frameModel | 1386 * @param {!WebInspector.TimelineFrameModelBase} frameModel |
1387 */ | 1387 */ |
1388 WebInspector.TimelineFlameChartView = function(delegate, timelineModel, frameMod
el) | 1388 WebInspector.TimelineFlameChartView = function(delegate, timelineModel, frameMod
el) |
1389 { | 1389 { |
1390 WebInspector.VBox.call(this); | 1390 WebInspector.VBox.call(this); |
1391 this.element.classList.add("timeline-flamechart"); | 1391 this.element.classList.add("timeline-flamechart"); |
1392 this._delegate = delegate; | 1392 this._delegate = delegate; |
1393 this._model = timelineModel; | 1393 this._model = timelineModel; |
1394 | 1394 |
1395 this._splitView = new WebInspector.SplitView(false, false, "timelineFlamecha
rtMainView", 150); | 1395 this._splitWidget = new WebInspector.SplitWidget(false, false, "timelineFlam
echartMainView", 150); |
1396 | 1396 |
1397 this._dataProvider = new WebInspector.TimelineFlameChartDataProvider(this._m
odel, frameModel); | 1397 this._dataProvider = new WebInspector.TimelineFlameChartDataProvider(this._m
odel, frameModel); |
1398 this._mainView = new WebInspector.FlameChart(this._dataProvider, this, true)
; | 1398 this._mainView = new WebInspector.FlameChart(this._dataProvider, this, true)
; |
1399 | 1399 |
1400 this._networkDataProvider = new WebInspector.TimelineFlameChartNetworkDataPr
ovider(this._model); | 1400 this._networkDataProvider = new WebInspector.TimelineFlameChartNetworkDataPr
ovider(this._model); |
1401 this._networkView = new WebInspector.FlameChart(this._networkDataProvider, t
his, true); | 1401 this._networkView = new WebInspector.FlameChart(this._networkDataProvider, t
his, true); |
1402 | 1402 |
1403 if (Runtime.experiments.isEnabled("networkRequestsOnTimeline")) { | 1403 if (Runtime.experiments.isEnabled("networkRequestsOnTimeline")) { |
1404 this._splitView.setMainView(this._mainView); | 1404 this._splitWidget.setMainWidget(this._mainView); |
1405 this._splitView.setSidebarView(this._networkView); | 1405 this._splitWidget.setSidebarWidget(this._networkView); |
1406 this._splitView.show(this.element); | 1406 this._splitWidget.show(this.element); |
1407 } else { | 1407 } else { |
1408 this._mainView.show(this.element); | 1408 this._mainView.show(this.element); |
1409 } | 1409 } |
1410 | 1410 |
1411 this._onMainEntrySelected = this._onEntrySelected.bind(this, this._dataProvi
der); | 1411 this._onMainEntrySelected = this._onEntrySelected.bind(this, this._dataProvi
der); |
1412 this._onNetworkEntrySelected = this._onEntrySelected.bind(this, this._networ
kDataProvider); | 1412 this._onNetworkEntrySelected = this._onEntrySelected.bind(this, this._networ
kDataProvider); |
1413 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStar
ted, this._onRecordingStarted, this); | 1413 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStar
ted, this._onRecordingStarted, this); |
1414 this._mainView.addEventListener(WebInspector.FlameChart.Events.EntrySelected
, this._onMainEntrySelected, this); | 1414 this._mainView.addEventListener(WebInspector.FlameChart.Events.EntrySelected
, this._onMainEntrySelected, this); |
1415 this._networkView.addEventListener(WebInspector.FlameChart.Events.EntrySelec
ted, this._onNetworkEntrySelected, this); | 1415 this._networkView.addEventListener(WebInspector.FlameChart.Events.EntrySelec
ted, this._onNetworkEntrySelected, this); |
1416 WebInspector.BlackboxSupport.addChangeListener(this._refresh, this); | 1416 WebInspector.BlackboxSupport.addChangeListener(this._refresh, this); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1461 * @override | 1461 * @override |
1462 */ | 1462 */ |
1463 wasShown: function() | 1463 wasShown: function() |
1464 { | 1464 { |
1465 this._mainView.scheduleUpdate(); | 1465 this._mainView.scheduleUpdate(); |
1466 this._networkView.scheduleUpdate(); | 1466 this._networkView.scheduleUpdate(); |
1467 }, | 1467 }, |
1468 | 1468 |
1469 /** | 1469 /** |
1470 * @override | 1470 * @override |
1471 * @return {!WebInspector.View} | 1471 * @return {!WebInspector.Widget} |
1472 */ | 1472 */ |
1473 view: function() | 1473 view: function() |
1474 { | 1474 { |
1475 return this; | 1475 return this; |
1476 }, | 1476 }, |
1477 | 1477 |
1478 /** | 1478 /** |
1479 * @override | 1479 * @override |
1480 */ | 1480 */ |
1481 reset: function() | 1481 reset: function() |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1558 this._delegate.select(timelineSelection); | 1558 this._delegate.select(timelineSelection); |
1559 }, | 1559 }, |
1560 | 1560 |
1561 /** | 1561 /** |
1562 * @param {boolean} enable | 1562 * @param {boolean} enable |
1563 * @param {boolean=} animate | 1563 * @param {boolean=} animate |
1564 */ | 1564 */ |
1565 enableNetworkPane: function(enable, animate) | 1565 enableNetworkPane: function(enable, animate) |
1566 { | 1566 { |
1567 if (enable) | 1567 if (enable) |
1568 this._splitView.showBoth(animate); | 1568 this._splitWidget.showBoth(animate); |
1569 else | 1569 else |
1570 this._splitView.hideSidebar(animate); | 1570 this._splitWidget.hideSidebar(animate); |
1571 }, | 1571 }, |
1572 | 1572 |
1573 _refresh: function() | 1573 _refresh: function() |
1574 { | 1574 { |
1575 this._dataProvider.reset(); | 1575 this._dataProvider.reset(); |
1576 this._mainView.scheduleUpdate(); | 1576 this._mainView.scheduleUpdate(); |
1577 this._networkDataProvider.reset(); | 1577 this._networkDataProvider.reset(); |
1578 this._networkView.scheduleUpdate(); | 1578 this._networkView.scheduleUpdate(); |
1579 }, | 1579 }, |
1580 | 1580 |
1581 __proto__: WebInspector.VBox.prototype | 1581 __proto__: WebInspector.VBox.prototype |
1582 } | 1582 } |
1583 | 1583 |
1584 /** | 1584 /** |
1585 * @constructor | 1585 * @constructor |
1586 * @param {!WebInspector.TimelineSelection} selection | 1586 * @param {!WebInspector.TimelineSelection} selection |
1587 * @param {number} entryIndex | 1587 * @param {number} entryIndex |
1588 */ | 1588 */ |
1589 WebInspector.TimelineFlameChartView.Selection = function(selection, entryIndex) | 1589 WebInspector.TimelineFlameChartView.Selection = function(selection, entryIndex) |
1590 { | 1590 { |
1591 this.timelineSelection = selection; | 1591 this.timelineSelection = selection; |
1592 this.entryIndex = entryIndex; | 1592 this.entryIndex = entryIndex; |
1593 } | 1593 } |
OLD | NEW |