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

Side by Side Diff: Source/devtools/front_end/layers/LayerPaintProfilerView.js

Issue 340043002: DevTools: untangle paint profiler for better reuse (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: added missing file Created 6 years, 6 months 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 | Annotate | Revision Log
« no previous file with comments | « Source/devtools/devtools.gypi ('k') | Source/devtools/front_end/layers/LayersPanel.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 /**
6 * @constructor
7 * @param {function(!WebInspector.Layer, string=)} showImageForLayerCallback
8 * @extends {WebInspector.SplitView}
9 */
10 WebInspector.LayerPaintProfilerView = function(showImageForLayerCallback)
11 {
12 WebInspector.SplitView.call(this, true, false);
13
14 this._showImageForLayerCallback = showImageForLayerCallback;
15 this._logTreeView = new WebInspector.PaintProfilerCommandLogView();
16 this._logTreeView.show(this.sidebarElement());
17 this._paintProfilerView = new WebInspector.PaintProfilerView(this._showImage .bind(this));
18 this._paintProfilerView.show(this.mainElement());
19
20 this._paintProfilerView.addEventListener(WebInspector.PaintProfilerView.Even ts.WindowChanged, this._onWindowChanged, this);
21 }
22
23 WebInspector.LayerPaintProfilerView.prototype = {
24 /**
25 * @param {!WebInspector.Layer} layer
26 */
27 profileLayer: function(layer)
28 {
29 layer.requestSnapshot(onSnapshotDone.bind(this));
30
31 /**
32 * @param {!WebInspector.PaintProfilerSnapshot=} snapshot
33 * @this {WebInspector.LayerPaintProfilerView}
34 */
35 function onSnapshotDone(snapshot)
36 {
37 this._layer = layer;
38 this._paintProfilerView.setSnapshot(snapshot || null);
39 this._logTreeView.setSnapshot(snapshot || null);
40 }
41 },
42
43 _onWindowChanged: function()
44 {
45 var window = this._paintProfilerView.windowBoundaries();
46 this._logTreeView.updateWindow(window.left, window.right);
47 },
48
49 /**
50 * @param {string=} imageURL
51 */
52 _showImage: function(imageURL)
53 {
54 this._showImageForLayerCallback(this._layer, imageURL);
55 },
56
57 __proto__: WebInspector.SplitView.prototype
58 };
59
OLDNEW
« no previous file with comments | « Source/devtools/devtools.gypi ('k') | Source/devtools/front_end/layers/LayersPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698