| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |