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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/animation/AnimationTimeline.js

Issue 2137773002: [DevTools] Replace the target type with capabilities (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 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
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 * @extends {WebInspector.VBox} 7 * @extends {WebInspector.VBox}
8 * @implements {WebInspector.TargetManager.Observer} 8 * @implements {WebInspector.TargetManager.Observer}
9 */ 9 */
10 WebInspector.AnimationTimeline = function() 10 WebInspector.AnimationTimeline = function()
(...skipping 17 matching lines...) Expand all
28 /** @type {!Map.<!DOMAgent.BackendNodeId, !WebInspector.AnimationTimeline.No deUI>} */ 28 /** @type {!Map.<!DOMAgent.BackendNodeId, !WebInspector.AnimationTimeline.No deUI>} */
29 this._nodesMap = new Map(); 29 this._nodesMap = new Map();
30 this._uiAnimations = []; 30 this._uiAnimations = [];
31 this._groupBuffer = []; 31 this._groupBuffer = [];
32 /** @type {!Map.<!WebInspector.AnimationModel.AnimationGroup, !WebInspector. AnimationGroupPreviewUI>} */ 32 /** @type {!Map.<!WebInspector.AnimationModel.AnimationGroup, !WebInspector. AnimationGroupPreviewUI>} */
33 this._previewMap = new Map(); 33 this._previewMap = new Map();
34 this._symbol = Symbol("animationTimeline"); 34 this._symbol = Symbol("animationTimeline");
35 /** @type {!Map.<string, !WebInspector.AnimationModel.Animation>} */ 35 /** @type {!Map.<string, !WebInspector.AnimationModel.Animation>} */
36 this._animationsMap = new Map(); 36 this._animationsMap = new Map();
37 WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebInspec tor.DOMModel.Events.NodeRemoved, this._nodeRemoved, this); 37 WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebInspec tor.DOMModel.Events.NodeRemoved, this._nodeRemoved, this);
38 WebInspector.targetManager.observeTargets(this, WebInspector.Target.Type.Pag e); 38 WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capabili ty.Browser);
39 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this._nod eChanged, this); 39 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this._nod eChanged, this);
40 } 40 }
41 41
42 WebInspector.AnimationTimeline.GlobalPlaybackRates = [1, 0.25, 0.1]; 42 WebInspector.AnimationTimeline.GlobalPlaybackRates = [1, 0.25, 0.1];
43 43
44 /** @enum {string} */ 44 /** @enum {string} */
45 WebInspector.AnimationTimeline._ControlState = { 45 WebInspector.AnimationTimeline._ControlState = {
46 Play: "play-outline", 46 Play: "play-outline",
47 Replay: "replay-outline", 47 Replay: "replay-outline",
48 Pause: "pause-outline" 48 Pause: "pause-outline"
49 } 49 }
50 50
51 WebInspector.AnimationTimeline.prototype = { 51 WebInspector.AnimationTimeline.prototype = {
52 wasShown: function() 52 wasShown: function()
53 { 53 {
54 for (var target of WebInspector.targetManager.targets(WebInspector.Targe t.Type.Page)) 54 for (var target of WebInspector.targetManager.targets(WebInspector.Targe t.Capability.Browser))
55 this._addEventListeners(target); 55 this._addEventListeners(target);
56 }, 56 },
57 57
58 willHide: function() 58 willHide: function()
59 { 59 {
60 for (var target of WebInspector.targetManager.targets(WebInspector.Targe t.Type.Page)) 60 for (var target of WebInspector.targetManager.targets(WebInspector.Targe t.Capability.Browser))
61 this._removeEventListeners(target); 61 this._removeEventListeners(target);
62 this._popoverHelper.hidePopover(); 62 this._popoverHelper.hidePopover();
63 }, 63 },
64 64
65 /** 65 /**
66 * @override 66 * @override
67 * @param {!WebInspector.Target} target 67 * @param {!WebInspector.Target} target
68 */ 68 */
69 targetAdded: function(target) 69 targetAdded: function(target)
70 { 70 {
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 */ 751 */
752 WebInspector.AnimationTimeline.StepTimingFunction.parse = function(text) { 752 WebInspector.AnimationTimeline.StepTimingFunction.parse = function(text) {
753 var match = text.match(/^step-(start|middle|end)$/); 753 var match = text.match(/^step-(start|middle|end)$/);
754 if (match) 754 if (match)
755 return new WebInspector.AnimationTimeline.StepTimingFunction(1, match[1] ); 755 return new WebInspector.AnimationTimeline.StepTimingFunction(1, match[1] );
756 match = text.match(/^steps\((\d+), (start|middle|end)\)$/); 756 match = text.match(/^steps\((\d+), (start|middle|end)\)$/);
757 if (match) 757 if (match)
758 return new WebInspector.AnimationTimeline.StepTimingFunction(parseInt(ma tch[1], 10), match[2]); 758 return new WebInspector.AnimationTimeline.StepTimingFunction(parseInt(ma tch[1], 10), match[2]);
759 return null; 759 return null;
760 } 760 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698