| 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.TimelineFrameModel} frameModel | 7 * @param {!WebInspector.TimelineFrameModel} frameModel |
| 8 * @extends {WebInspector.SplitWidget} | 8 * @extends {WebInspector.SplitWidget} |
| 9 */ | 9 */ |
| 10 WebInspector.TimelinePaintProfilerView = function(frameModel) | 10 WebInspector.TimelinePaintProfilerView = function(frameModel) |
| (...skipping 12 matching lines...) Expand all Loading... |
| 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.setSidebarWidget(this._paintProfilerView); | 26 this.setSidebarWidget(this._paintProfilerView); |
| 27 | 27 |
| 28 this._logTreeView = new WebInspector.PaintProfilerCommandLogView(); | 28 this._logTreeView = new WebInspector.PaintProfilerCommandLogView(); |
| 29 this._logAndImageSplitWidget.setSidebarWidget(this._logTreeView); | 29 this._logAndImageSplitWidget.setSidebarWidget(this._logTreeView); |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 WebInspector.TimelinePaintProfilerView.prototype = { | 32 WebInspector.TimelinePaintProfilerView.prototype = { |
| 33 /** |
| 34 * @override |
| 35 */ |
| 33 wasShown: function() | 36 wasShown: function() |
| 34 { | 37 { |
| 35 if (this._needsUpdateWhenVisible) { | 38 if (this._needsUpdateWhenVisible) { |
| 36 this._needsUpdateWhenVisible = false; | 39 this._needsUpdateWhenVisible = false; |
| 37 this._update(); | 40 this._update(); |
| 38 } | 41 } |
| 39 }, | 42 }, |
| 40 | 43 |
| 41 /** | 44 /** |
| 42 * @param {!WebInspector.PaintProfilerSnapshot} snapshot | 45 * @param {!WebInspector.PaintProfilerSnapshot} snapshot |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 this._imageContainer = this.contentElement.createChild("div", "paint-profile
r-image-container"); | 151 this._imageContainer = this.contentElement.createChild("div", "paint-profile
r-image-container"); |
| 149 this._imageElement = this._imageContainer.createChild("img"); | 152 this._imageElement = this._imageContainer.createChild("img"); |
| 150 this._maskElement = this._imageContainer.createChild("div"); | 153 this._maskElement = this._imageContainer.createChild("div"); |
| 151 this._imageElement.addEventListener("load", this._updateImagePosition.bind(t
his), false); | 154 this._imageElement.addEventListener("load", this._updateImagePosition.bind(t
his), false); |
| 152 | 155 |
| 153 this._transformController = new WebInspector.TransformController(this.conten
tElement, true); | 156 this._transformController = new WebInspector.TransformController(this.conten
tElement, true); |
| 154 this._transformController.addEventListener(WebInspector.TransformController.
Events.TransformChanged, this._updateImagePosition, this); | 157 this._transformController.addEventListener(WebInspector.TransformController.
Events.TransformChanged, this._updateImagePosition, this); |
| 155 }; | 158 }; |
| 156 | 159 |
| 157 WebInspector.TimelinePaintImageView.prototype = { | 160 WebInspector.TimelinePaintImageView.prototype = { |
| 161 /** |
| 162 * @override |
| 163 */ |
| 158 onResize: function() | 164 onResize: function() |
| 159 { | 165 { |
| 160 if (this._imageElement.src) | 166 if (this._imageElement.src) |
| 161 this._updateImagePosition(); | 167 this._updateImagePosition(); |
| 162 }, | 168 }, |
| 163 | 169 |
| 164 _updateImagePosition: function() | 170 _updateImagePosition: function() |
| 165 { | 171 { |
| 166 var width = this._imageElement.naturalWidth; | 172 var width = this._imageElement.naturalWidth; |
| 167 var height = this._imageElement.naturalHeight; | 173 var height = this._imageElement.naturalHeight; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 * @param {?DOMAgent.Rect} maskRectangle | 217 * @param {?DOMAgent.Rect} maskRectangle |
| 212 */ | 218 */ |
| 213 setMask: function(maskRectangle) | 219 setMask: function(maskRectangle) |
| 214 { | 220 { |
| 215 this._maskRectangle = maskRectangle; | 221 this._maskRectangle = maskRectangle; |
| 216 this._maskElement.classList.toggle("hidden", !maskRectangle); | 222 this._maskElement.classList.toggle("hidden", !maskRectangle); |
| 217 }, | 223 }, |
| 218 | 224 |
| 219 __proto__: WebInspector.Widget.prototype | 225 __proto__: WebInspector.Widget.prototype |
| 220 }; | 226 }; |
| OLD | NEW |