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 */ |
11 WebInspector.AnimationModel = function(target) | 11 WebInspector.AnimationModel = function(target) |
12 { | 12 { |
13 WebInspector.SDKModel.call(this, WebInspector.AnimationModel, target); | 13 WebInspector.SDKModel.call(this, WebInspector.AnimationModel, target); |
14 this._agent = target.animationAgent(); | 14 this._agent = target.animationAgent(); |
15 target.registerAnimationDispatcher(new WebInspector.AnimationDispatcher(this
)); | 15 target.registerAnimationDispatcher(new WebInspector.AnimationDispatcher(this
)); |
16 /** @type {!Map.<string, !WebInspector.AnimationModel.Animation>} */ | 16 /** @type {!Map.<string, !WebInspector.AnimationModel.Animation>} */ |
17 this._animationsById = new Map(); | 17 this._animationsById = new Map(); |
18 /** @type {!Map.<string, !WebInspector.AnimationModel.AnimationGroup>} */ | 18 /** @type {!Map.<string, !WebInspector.AnimationModel.AnimationGroup>} */ |
19 this._animationGroups = new Map(); | 19 this._animationGroups = new Map(); |
20 /** @type {!Array.<string>} */ | 20 /** @type {!Array.<string>} */ |
21 this._pendingAnimations = []; | 21 this._pendingAnimations = []; |
22 this._playbackRate = 1; | 22 this._playbackRate = 1; |
23 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Eve
ntTypes.MainFrameNavigated, this._reset, this); | 23 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Eve
ntTypes.MainFrameNavigated, this._reset, this); |
24 this._screenshotCapture = new WebInspector.AnimationModel.ScreenshotCapture(
target, this); | 24 this._screenshotCapture = new WebInspector.AnimationModel.ScreenshotCapture(
target, this); |
25 } | 25 } |
26 | 26 |
| 27 /** @enum {symbol} */ |
27 WebInspector.AnimationModel.Events = { | 28 WebInspector.AnimationModel.Events = { |
28 AnimationGroupStarted: "AnimationGroupStarted", | 29 AnimationGroupStarted: Symbol("AnimationGroupStarted"), |
29 ModelReset: "ModelReset" | 30 ModelReset: Symbol("ModelReset") |
30 } | 31 } |
31 | 32 |
32 WebInspector.AnimationModel.prototype = { | 33 WebInspector.AnimationModel.prototype = { |
33 _reset: function() | 34 _reset: function() |
34 { | 35 { |
35 this._animationsById.clear(); | 36 this._animationsById.clear(); |
36 this._animationGroups.clear(); | 37 this._animationGroups.clear(); |
37 this._pendingAnimations = []; | 38 this._pendingAnimations = []; |
38 this.dispatchEventToListeners(WebInspector.AnimationModel.Events.ModelRe
set); | 39 this.dispatchEventToListeners(WebInspector.AnimationModel.Events.ModelRe
set); |
39 }, | 40 }, |
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
937 if (!this._capturing) | 938 if (!this._capturing) |
938 return; | 939 return; |
939 | 940 |
940 delete this._stopTimer; | 941 delete this._stopTimer; |
941 delete this._endTime; | 942 delete this._endTime; |
942 this._requests = []; | 943 this._requests = []; |
943 this._capturing = false; | 944 this._capturing = false; |
944 this._target.pageAgent().stopScreencast(); | 945 this._target.pageAgent().stopScreencast(); |
945 } | 946 } |
946 } | 947 } |
OLD | NEW |