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

Unified Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineLayersView.js

Issue 2466123002: DevTools: reformat front-end code to match chromium style. (Closed)
Patch Set: all done Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/timeline/TimelineLayersView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineLayersView.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineLayersView.js
index 9fa698ae92337c90ffd7dc863e36b604621060f7..c94f8ea07b01c8df31d79e4fc13d6b82b9152666 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineLayersView.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineLayersView.js
@@ -3,22 +3,22 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-
/**
- * @constructor
- * @extends {WebInspector.SplitWidget}
- * @param {!WebInspector.TimelineModel} model
- * @param {function(!WebInspector.PaintProfilerSnapshot)} showPaintProfilerCallback
+ * @unrestricted
*/
-WebInspector.TimelineLayersView = function(model, showPaintProfilerCallback)
-{
- WebInspector.SplitWidget.call(this, true, false, "timelineLayersView");
+WebInspector.TimelineLayersView = class extends WebInspector.SplitWidget {
+ /**
+ * @param {!WebInspector.TimelineModel} model
+ * @param {function(!WebInspector.PaintProfilerSnapshot)} showPaintProfilerCallback
+ */
+ constructor(model, showPaintProfilerCallback) {
+ super(true, false, 'timelineLayersView');
this._model = model;
this._showPaintProfilerCallback = showPaintProfilerCallback;
- this.element.classList.add("timeline-layers-view");
- this._rightSplitWidget = new WebInspector.SplitWidget(true, true, "timelineLayersViewDetails");
- this._rightSplitWidget.element.classList.add("timeline-layers-view-properties");
+ this.element.classList.add('timeline-layers-view');
+ this._rightSplitWidget = new WebInspector.SplitWidget(true, true, 'timelineLayersViewDetails');
+ this._rightSplitWidget.element.classList.add('timeline-layers-view-properties');
this.setMainWidget(this._rightSplitWidget);
var vbox = new WebInspector.VBox();
@@ -30,51 +30,49 @@ WebInspector.TimelineLayersView = function(model, showPaintProfilerCallback)
vbox.element.appendChild(layerTreeOutline.element);
this._layers3DView = new WebInspector.Layers3DView(this._layerViewHost);
- this._layers3DView.addEventListener(WebInspector.Layers3DView.Events.PaintProfilerRequested, this._onPaintProfilerRequested, this);
+ this._layers3DView.addEventListener(
+ WebInspector.Layers3DView.Events.PaintProfilerRequested, this._onPaintProfilerRequested, this);
this._rightSplitWidget.setMainWidget(this._layers3DView);
var layerDetailsView = new WebInspector.LayerDetailsView(this._layerViewHost);
this._rightSplitWidget.setSidebarWidget(layerDetailsView);
- layerDetailsView.addEventListener(WebInspector.LayerDetailsView.Events.PaintProfilerRequested, this._onPaintProfilerRequested, this);
-};
-
-WebInspector.TimelineLayersView.prototype = {
- /**
- * @param {!WebInspector.TracingFrameLayerTree} frameLayerTree
- */
- showLayerTree: function(frameLayerTree)
- {
- this._frameLayerTree = frameLayerTree;
- if (this.isShowing())
- this._update();
- else
- this._updateWhenVisible = true;
- },
+ layerDetailsView.addEventListener(
+ WebInspector.LayerDetailsView.Events.PaintProfilerRequested, this._onPaintProfilerRequested, this);
+ }
- wasShown: function()
- {
- if (this._updateWhenVisible) {
- this._updateWhenVisible = false;
- this._update();
- }
- },
+ /**
+ * @param {!WebInspector.TracingFrameLayerTree} frameLayerTree
+ */
+ showLayerTree(frameLayerTree) {
+ this._frameLayerTree = frameLayerTree;
+ if (this.isShowing())
+ this._update();
+ else
+ this._updateWhenVisible = true;
+ }
- /**
- * @param {!WebInspector.Event} event
- */
- _onPaintProfilerRequested: function(event)
- {
- var selection = /** @type {!WebInspector.LayerView.Selection} */ (event.data);
- this._layers3DView.snapshotForSelection(selection).then(snapshotWithRect => {
- if (snapshotWithRect)
- this._showPaintProfilerCallback(snapshotWithRect.snapshot);
- });
- },
+ /**
+ * @override
+ */
+ wasShown() {
+ if (this._updateWhenVisible) {
+ this._updateWhenVisible = false;
+ this._update();
+ }
+ }
- _update: function()
- {
- this._frameLayerTree.layerTreePromise().then(layerTree => this._layerViewHost.setLayerTree(layerTree));
- },
+ /**
+ * @param {!WebInspector.Event} event
+ */
+ _onPaintProfilerRequested(event) {
+ var selection = /** @type {!WebInspector.LayerView.Selection} */ (event.data);
+ this._layers3DView.snapshotForSelection(selection).then(snapshotWithRect => {
+ if (snapshotWithRect)
+ this._showPaintProfilerCallback(snapshotWithRect.snapshot);
+ });
+ }
- __proto__: WebInspector.SplitWidget.prototype
+ _update() {
+ this._frameLayerTree.layerTreePromise().then(layerTree => this._layerViewHost.setLayerTree(layerTree));
+ }
};

Powered by Google App Engine
This is Rietveld 408576698