OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @constructor | 6 * @constructor |
7 * @param {function(!WebInspector.Layer, string=)} showImageForLayerCallback | 7 * @param {function(!WebInspector.Layer, string=)} showImageForLayerCallback |
8 * @extends {WebInspector.SplitWidget} | 8 * @extends {WebInspector.SplitWidget} |
9 */ | 9 */ |
10 WebInspector.LayerPaintProfilerView = function(showImageForLayerCallback) | 10 WebInspector.LayerPaintProfilerView = function(showImageForLayerCallback) |
11 { | 11 { |
12 WebInspector.SplitWidget.call(this, true, false); | 12 WebInspector.SplitWidget.call(this, true, false); |
13 | 13 |
14 this._showImageForLayerCallback = showImageForLayerCallback; | 14 this._showImageForLayerCallback = showImageForLayerCallback; |
15 this._logTreeView = new WebInspector.PaintProfilerCommandLogView(); | 15 this._logTreeView = new WebInspector.PaintProfilerCommandLogView(); |
16 this.setSidebarWidget(this._logTreeView); | 16 this.setSidebarWidget(this._logTreeView); |
17 this._paintProfilerView = new WebInspector.PaintProfilerView(this._showImage
.bind(this)); | 17 this._paintProfilerView = new WebInspector.PaintProfilerView(this._showImage
.bind(this)); |
18 this.setMainWidget(this._paintProfilerView); | 18 this.setMainWidget(this._paintProfilerView); |
19 | 19 |
20 this._paintProfilerView.addEventListener(WebInspector.PaintProfilerView.Even
ts.WindowChanged, this._onWindowChanged, this); | 20 this._paintProfilerView.addEventListener(WebInspector.PaintProfilerView.Even
ts.WindowChanged, this._onWindowChanged, this); |
21 } | 21 }; |
22 | 22 |
23 WebInspector.LayerPaintProfilerView.prototype = { | 23 WebInspector.LayerPaintProfilerView.prototype = { |
24 /** | 24 /** |
25 * @param {!WebInspector.Layer} layer | 25 * @param {!WebInspector.Layer} layer |
26 */ | 26 */ |
27 profileLayer: function(layer) | 27 profileLayer: function(layer) |
28 { | 28 { |
29 this._logTreeView.setCommandLog(null, []); | 29 this._logTreeView.setCommandLog(null, []); |
30 this._paintProfilerView.setSnapshotAndLog(null, [], null); | 30 this._paintProfilerView.setSnapshotAndLog(null, [], null); |
31 /** @type {!WebInspector.AgentLayer} */ (layer).requestSnapshot(onSnapsh
otDone.bind(this)); | 31 /** @type {!WebInspector.AgentLayer} */ (layer).requestSnapshot(onSnapsh
otDone.bind(this)); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 * @param {string=} imageURL | 69 * @param {string=} imageURL |
70 */ | 70 */ |
71 _showImage: function(imageURL) | 71 _showImage: function(imageURL) |
72 { | 72 { |
73 this._showImageForLayerCallback(this._layer, imageURL); | 73 this._showImageForLayerCallback(this._layer, imageURL); |
74 }, | 74 }, |
75 | 75 |
76 __proto__: WebInspector.SplitWidget.prototype | 76 __proto__: WebInspector.SplitWidget.prototype |
77 }; | 77 }; |
78 | 78 |
OLD | NEW |