Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(967)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/layers/LayersPanel.js

Issue 2571983002: DevTools: do not add paint profiler tab more than once on Layers panel (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 };
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/ui/TabbedPane.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698