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 {!WebInspector.TracingTimelineFrameModel} frameModel | 7 * @param {!WebInspector.TracingTimelineFrameModel} frameModel |
8 * @extends {WebInspector.SplitView} | 8 * @extends {WebInspector.SplitWidget} |
9 */ | 9 */ |
10 WebInspector.TimelinePaintProfilerView = function(frameModel) | 10 WebInspector.TimelinePaintProfilerView = function(frameModel) |
11 { | 11 { |
12 WebInspector.SplitView.call(this, false, false); | 12 WebInspector.SplitWidget.call(this, false, false); |
13 this.element.classList.add("timeline-paint-profiler-view"); | 13 this.element.classList.add("timeline-paint-profiler-view"); |
14 this.setSidebarSize(60); | 14 this.setSidebarSize(60); |
15 this.setResizable(false); | 15 this.setResizable(false); |
16 | 16 |
17 this._frameModel = frameModel; | 17 this._frameModel = frameModel; |
18 this._logAndImageSplitView = new WebInspector.SplitView(true, false); | 18 this._logAndImageSplitWidget = new WebInspector.SplitWidget(true, false); |
19 this._logAndImageSplitView.element.classList.add("timeline-paint-profiler-lo
g-split"); | 19 this._logAndImageSplitWidget.element.classList.add("timeline-paint-profiler-
log-split"); |
20 this.setMainView(this._logAndImageSplitView); | 20 this.setMainWidget(this._logAndImageSplitWidget); |
21 this._imageView = new WebInspector.TimelinePaintImageView(); | 21 this._imageView = new WebInspector.TimelinePaintImageView(); |
22 this._logAndImageSplitView.setMainView(this._imageView); | 22 this._logAndImageSplitWidget.setMainWidget(this._imageView); |
23 | 23 |
24 this._paintProfilerView = new WebInspector.PaintProfilerView(this._imageView
.showImage.bind(this._imageView)); | 24 this._paintProfilerView = new WebInspector.PaintProfilerView(this._imageView
.showImage.bind(this._imageView)); |
25 this._paintProfilerView.addEventListener(WebInspector.PaintProfilerView.Even
ts.WindowChanged, this._onWindowChanged, this); | 25 this._paintProfilerView.addEventListener(WebInspector.PaintProfilerView.Even
ts.WindowChanged, this._onWindowChanged, this); |
26 this.setSidebarView(this._paintProfilerView); | 26 this.setSidebarWidget(this._paintProfilerView); |
27 | 27 |
28 this._logTreeView = new WebInspector.PaintProfilerCommandLogView(); | 28 this._logTreeView = new WebInspector.PaintProfilerCommandLogView(); |
29 this._logAndImageSplitView.setSidebarView(this._logTreeView); | 29 this._logAndImageSplitWidget.setSidebarWidget(this._logTreeView); |
30 } | 30 } |
31 | 31 |
32 WebInspector.TimelinePaintProfilerView.prototype = { | 32 WebInspector.TimelinePaintProfilerView.prototype = { |
33 wasShown: function() | 33 wasShown: function() |
34 { | 34 { |
35 if (this._updateWhenVisible) { | 35 if (this._updateWhenVisible) { |
36 this._updateWhenVisible = false; | 36 this._updateWhenVisible = false; |
37 this._update(); | 37 this._update(); |
38 } | 38 } |
39 }, | 39 }, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 this._lastLoadedSnapshot.dispose(); | 114 this._lastLoadedSnapshot.dispose(); |
115 this._lastLoadedSnapshot = null; | 115 this._lastLoadedSnapshot = null; |
116 }, | 116 }, |
117 | 117 |
118 _onWindowChanged: function() | 118 _onWindowChanged: function() |
119 { | 119 { |
120 var window = this._paintProfilerView.windowBoundaries(); | 120 var window = this._paintProfilerView.windowBoundaries(); |
121 this._logTreeView.updateWindow(window.left, window.right); | 121 this._logTreeView.updateWindow(window.left, window.right); |
122 }, | 122 }, |
123 | 123 |
124 __proto__: WebInspector.SplitView.prototype | 124 __proto__: WebInspector.SplitWidget.prototype |
125 }; | 125 }; |
126 | 126 |
127 /** | 127 /** |
128 * @constructor | 128 * @constructor |
129 * @extends {WebInspector.View} | 129 * @extends {WebInspector.Widget} |
130 */ | 130 */ |
131 WebInspector.TimelinePaintImageView = function() | 131 WebInspector.TimelinePaintImageView = function() |
132 { | 132 { |
133 WebInspector.View.call(this); | 133 WebInspector.Widget.call(this); |
134 this.element.classList.add("fill", "paint-profiler-image-view"); | 134 this.element.classList.add("fill", "paint-profiler-image-view"); |
135 this._imageContainer = this.element.createChild("div", "paint-profiler-image
-container"); | 135 this._imageContainer = this.element.createChild("div", "paint-profiler-image
-container"); |
136 this._imageElement = this._imageContainer.createChild("img"); | 136 this._imageElement = this._imageContainer.createChild("img"); |
137 this._maskElement = this._imageContainer.createChild("div"); | 137 this._maskElement = this._imageContainer.createChild("div"); |
138 this._imageElement.addEventListener("load", this._updateImagePosition.bind(t
his), false); | 138 this._imageElement.addEventListener("load", this._updateImagePosition.bind(t
his), false); |
139 | 139 |
140 this._transformController = new WebInspector.TransformController(this.elemen
t, true); | 140 this._transformController = new WebInspector.TransformController(this.elemen
t, true); |
141 this._transformController.addEventListener(WebInspector.TransformController.
Events.TransformChanged, this._updateImagePosition, this); | 141 this._transformController.addEventListener(WebInspector.TransformController.
Events.TransformChanged, this._updateImagePosition, this); |
142 } | 142 } |
143 | 143 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 195 |
196 /** | 196 /** |
197 * @param {?DOMAgent.Rect} maskRectangle | 197 * @param {?DOMAgent.Rect} maskRectangle |
198 */ | 198 */ |
199 setMask: function(maskRectangle) | 199 setMask: function(maskRectangle) |
200 { | 200 { |
201 this._maskRectangle = maskRectangle; | 201 this._maskRectangle = maskRectangle; |
202 this._maskElement.classList.toggle("hidden", !maskRectangle); | 202 this._maskElement.classList.toggle("hidden", !maskRectangle); |
203 }, | 203 }, |
204 | 204 |
205 __proto__: WebInspector.View.prototype | 205 __proto__: WebInspector.Widget.prototype |
206 }; | 206 }; |
OLD | NEW |