Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 /** | 6 /** |
| 7 * @constructor | 7 * @constructor |
| 8 * @extends {WebInspector.SDKModel} | 8 * @extends {WebInspector.SDKModel} |
| 9 * @param {!WebInspector.Target} target | 9 * @param {!WebInspector.Target} target |
| 10 */ | 10 */ |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 813 /** | 813 /** |
| 814 * @param {!WebInspector.AnimationModel.AnimationGroup} group | 814 * @param {!WebInspector.AnimationModel.AnimationGroup} group |
| 815 */ | 815 */ |
| 816 _update: function(group) | 816 _update: function(group) |
| 817 { | 817 { |
| 818 this._model._releaseAnimations(this._animationIds()); | 818 this._model._releaseAnimations(this._animationIds()); |
| 819 this._animations = group._animations; | 819 this._animations = group._animations; |
| 820 }, | 820 }, |
| 821 | 821 |
| 822 /** | 822 /** |
| 823 * @param {function(?)=} onImageLoad | |
|
lushnikov
2016/08/01 23:16:11
Let's not pass onImageLoad here
luoe
2016/08/02 00:24:10
Yeah, I should have realized this was awkward. Mo
| |
| 823 * @return {!Array.<!Image>} | 824 * @return {!Array.<!Image>} |
| 824 */ | 825 */ |
| 825 screenshots: function() | 826 screenshots: function(onImageLoad) |
| 826 { | 827 { |
| 827 for (var i = 0; i < this._screenshots.length; ++i) { | 828 for (var i = 0; i < this._screenshots.length; ++i) { |
| 828 var image = new Image(); | 829 var image = new Image(); |
| 830 if (onImageLoad) | |
| 831 image.onload = /** @type {function(?Event)} **/ (onImageLoad); | |
| 829 image.src = "data:image/jpeg;base64," + this._screenshots[i]; | 832 image.src = "data:image/jpeg;base64," + this._screenshots[i]; |
| 830 this._screenshotImages.push(image); | 833 this._screenshotImages.push(image); |
| 831 } | 834 } |
| 832 this._screenshots = []; | 835 this._screenshots = []; |
| 833 return this._screenshotImages; | 836 return this._screenshotImages; |
| 834 }, | 837 }, |
| 835 | 838 |
| 836 __proto__: WebInspector.SDKObject.prototype | 839 __proto__: WebInspector.SDKObject.prototype |
| 837 } | 840 } |
| 838 | 841 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 945 if (!this._capturing) | 948 if (!this._capturing) |
| 946 return; | 949 return; |
| 947 | 950 |
| 948 delete this._stopTimer; | 951 delete this._stopTimer; |
| 949 delete this._endTime; | 952 delete this._endTime; |
| 950 this._requests = []; | 953 this._requests = []; |
| 951 this._capturing = false; | 954 this._capturing = false; |
| 952 this._target.pageAgent().stopScreencast(); | 955 this._target.pageAgent().stopScreencast(); |
| 953 } | 956 } |
| 954 } | 957 } |
| OLD | NEW |