| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 149 |
| 150 /** | 150 /** |
| 151 * @param {!Common.Event} event | 151 * @param {!Common.Event} event |
| 152 */ | 152 */ |
| 153 _onPaintProfileRequested(event) { | 153 _onPaintProfileRequested(event) { |
| 154 var selection = /** @type {!LayerViewer.LayerView.Selection} */ (event.data)
; | 154 var selection = /** @type {!LayerViewer.LayerView.Selection} */ (event.data)
; |
| 155 this._layers3DView.snapshotForSelection(selection).then(snapshotWithRect =>
{ | 155 this._layers3DView.snapshotForSelection(selection).then(snapshotWithRect =>
{ |
| 156 if (!snapshotWithRect) | 156 if (!snapshotWithRect) |
| 157 return; | 157 return; |
| 158 this._layerBeingProfiled = selection.layer(); | 158 this._layerBeingProfiled = selection.layer(); |
| 159 this._tabbedPane.appendTab( | 159 if (!this._tabbedPane.hasTab(Layers.LayersPanel.DetailsViewTabs.Profiler))
{ |
| 160 Layers.LayersPanel.DetailsViewTabs.Profiler, Common.UIString('Profiler
'), this._paintProfilerView, undefined, | 160 this._tabbedPane.appendTab( |
| 161 true, true); | 161 Layers.LayersPanel.DetailsViewTabs.Profiler, Common.UIString('Profil
er'), this._paintProfilerView, |
| 162 undefined, true, true); |
| 163 } |
| 162 this._tabbedPane.selectTab(Layers.LayersPanel.DetailsViewTabs.Profiler); | 164 this._tabbedPane.selectTab(Layers.LayersPanel.DetailsViewTabs.Profiler); |
| 163 this._paintProfilerView.profile(snapshotWithRect.snapshot); | 165 this._paintProfilerView.profile(snapshotWithRect.snapshot); |
| 164 }); | 166 }); |
| 165 } | 167 } |
| 166 | 168 |
| 167 /** | 169 /** |
| 168 * @param {!Common.Event} event | 170 * @param {!Common.Event} event |
| 169 */ | 171 */ |
| 170 _onTabClosed(event) { | 172 _onTabClosed(event) { |
| 171 if (event.data.tabId !== Layers.LayersPanel.DetailsViewTabs.Profiler || !thi
s._layerBeingProfiled) | 173 if (event.data.tabId !== Layers.LayersPanel.DetailsViewTabs.Profiler || !thi
s._layerBeingProfiled) |
| (...skipping 15 matching lines...) Expand all Loading... |
| 187 */ | 189 */ |
| 188 _onScaleChanged(event) { | 190 _onScaleChanged(event) { |
| 189 this._paintProfilerView.setScale(/** @type {number} */ (event.data)); | 191 this._paintProfilerView.setScale(/** @type {number} */ (event.data)); |
| 190 } | 192 } |
| 191 }; | 193 }; |
| 192 | 194 |
| 193 Layers.LayersPanel.DetailsViewTabs = { | 195 Layers.LayersPanel.DetailsViewTabs = { |
| 194 Details: 'details', | 196 Details: 'details', |
| 195 Profiler: 'profiler' | 197 Profiler: 'profiler' |
| 196 }; | 198 }; |
| OLD | NEW |