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

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

Issue 1324193003: Devtools Animations: Update only page targets (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 this._pauseButton.element.classList.toggle("pause-toolbar-item"); 199 this._pauseButton.element.classList.toggle("pause-toolbar-item");
200 this._pauseButton.element.classList.toggle("play-toolbar-item"); 200 this._pauseButton.element.classList.toggle("play-toolbar-item");
201 if (this._scrubberPlayer) 201 if (this._scrubberPlayer)
202 this._scrubberPlayer.playbackRate = this._playbackRate(); 202 this._scrubberPlayer.playbackRate = this._playbackRate();
203 }, 203 },
204 204
205 _replay: function() 205 _replay: function()
206 { 206 {
207 if (this.startTime() === undefined) 207 if (this.startTime() === undefined)
208 return; 208 return;
209 var targets = WebInspector.targetManager.targets(); 209 for (var target of WebInspector.targetManager.targets(WebInspector.Targe t.Type.Page))
210 for (var target of targets)
211 target.animationAgent().setCurrentTime(/** @type {number} */(this.st artTime())); 210 target.animationAgent().setCurrentTime(/** @type {number} */(this.st artTime()));
211
212 this._animateTime(0); 212 this._animateTime(0);
213 }, 213 },
214 214
215 /** 215 /**
216 * @return {number} 216 * @return {number}
217 */ 217 */
218 _defaultDuration: function () 218 _defaultDuration: function ()
219 { 219 {
220 return 100; 220 return 100;
221 }, 221 },
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 500
501 /** 501 /**
502 * @param {!Event} event 502 * @param {!Event} event
503 */ 503 */
504 _scrubberDragMove: function(event) 504 _scrubberDragMove: function(event)
505 { 505 {
506 var delta = event.x - this._originalMousePosition.x; 506 var delta = event.x - this._originalMousePosition.x;
507 this._scrubberPlayer.currentTime = Math.min(this._originalScrubberTime + delta / this.pixelMsRatio(), this.duration() - this._scrubberRadius / this.pixe lMsRatio()); 507 this._scrubberPlayer.currentTime = Math.min(this._originalScrubberTime + delta / this.pixelMsRatio(), this.duration() - this._scrubberRadius / this.pixe lMsRatio());
508 var currentTime = Math.max(0, Math.round(this._scrubberPlayer.currentTim e)); 508 var currentTime = Math.max(0, Math.round(this._scrubberPlayer.currentTim e));
509 this._timelineScrubberHead.textContent = WebInspector.UIString(Number.mi llisToString(currentTime)); 509 this._timelineScrubberHead.textContent = WebInspector.UIString(Number.mi llisToString(currentTime));
510 var targets = WebInspector.targetManager.targets(); 510 for (var target of WebInspector.targetManager.targets(WebInspector.Targe t.Type.Page))
511 for (var target of targets)
512 target.animationAgent().setCurrentTime(/** @type {number} */(this.st artTime() + currentTime)); 511 target.animationAgent().setCurrentTime(/** @type {number} */(this.st artTime() + currentTime));
513 }, 512 },
514 513
515 /** 514 /**
516 * @param {!Event} event 515 * @param {!Event} event
517 */ 516 */
518 _scrubberDragEnd: function(event) 517 _scrubberDragEnd: function(event)
519 { 518 {
520 if (this._scrubberPlayer.currentTime < this.duration() - this._scrubberR adius / this.pixelMsRatio()) 519 if (this._scrubberPlayer.currentTime < this.duration() - this._scrubberR adius / this.pixelMsRatio())
521 this._scrubberPlayer.play(); 520 this._scrubberPlayer.play();
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 "Light Blue": WebInspector.Color.parse("#03A9F4"), 1090 "Light Blue": WebInspector.Color.parse("#03A9F4"),
1092 "Deep Orange": WebInspector.Color.parse("#FF5722"), 1091 "Deep Orange": WebInspector.Color.parse("#FF5722"),
1093 "Blue": WebInspector.Color.parse("#5677FC"), 1092 "Blue": WebInspector.Color.parse("#5677FC"),
1094 "Lime": WebInspector.Color.parse("#CDDC39"), 1093 "Lime": WebInspector.Color.parse("#CDDC39"),
1095 "Blue Grey": WebInspector.Color.parse("#607D8B"), 1094 "Blue Grey": WebInspector.Color.parse("#607D8B"),
1096 "Pink": WebInspector.Color.parse("#E91E63"), 1095 "Pink": WebInspector.Color.parse("#E91E63"),
1097 "Green": WebInspector.Color.parse("#0F9D58"), 1096 "Green": WebInspector.Color.parse("#0F9D58"),
1098 "Brown": WebInspector.Color.parse("#795548"), 1097 "Brown": WebInspector.Color.parse("#795548"),
1099 "Cyan": WebInspector.Color.parse("#00BCD4") 1098 "Cyan": WebInspector.Color.parse("#00BCD4")
1100 } 1099 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698