| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 */ | 8 */ |
| 9 WebInspector.ChartViewport = function() | 9 WebInspector.ChartViewport = function() |
| 10 { | 10 { |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 /** | 336 /** |
| 337 * @param {!Event} e | 337 * @param {!Event} e |
| 338 * @private | 338 * @private |
| 339 */ | 339 */ |
| 340 _handleZoomPanKeys: function(e) | 340 _handleZoomPanKeys: function(e) |
| 341 { | 341 { |
| 342 if (!WebInspector.KeyboardShortcut.hasNoModifiers(e)) | 342 if (!WebInspector.KeyboardShortcut.hasNoModifiers(e)) |
| 343 return; | 343 return; |
| 344 var zoomMultiplier = e.shiftKey ? 0.8 : 0.3; | 344 var zoomMultiplier = e.shiftKey ? 0.8 : 0.3; |
| 345 var panMultiplier = e.shiftKey ? 320 : 80; | 345 var panMultiplier = e.shiftKey ? 320 : 80; |
| 346 if (e.keyCode === "A".charCodeAt(0)) { | 346 if (e.code === "KeyA") { |
| 347 this._handlePanGesture(-panMultiplier * this._pixelToTime); | 347 this._handlePanGesture(-panMultiplier * this._pixelToTime); |
| 348 e.consume(true); | 348 e.consume(true); |
| 349 } else if (e.keyCode === "D".charCodeAt(0)) { | 349 } else if (e.code === "KeyD") { |
| 350 this._handlePanGesture(panMultiplier * this._pixelToTime); | 350 this._handlePanGesture(panMultiplier * this._pixelToTime); |
| 351 e.consume(true); | 351 e.consume(true); |
| 352 } else if (e.keyCode === "W".charCodeAt(0)) { | 352 } else if (e.code === "KeyW") { |
| 353 this._handleZoomGesture(-zoomMultiplier); | 353 this._handleZoomGesture(-zoomMultiplier); |
| 354 e.consume(true); | 354 e.consume(true); |
| 355 } else if (e.keyCode === "S".charCodeAt(0)) { | 355 } else if (e.code === "KeyS") { |
| 356 this._handleZoomGesture(zoomMultiplier); | 356 this._handleZoomGesture(zoomMultiplier); |
| 357 e.consume(true); | 357 e.consume(true); |
| 358 } | 358 } |
| 359 }, | 359 }, |
| 360 | 360 |
| 361 /** | 361 /** |
| 362 * @param {number} zoom | 362 * @param {number} zoom |
| 363 * @private | 363 * @private |
| 364 */ | 364 */ |
| 365 _handleZoomGesture: function(zoom) | 365 _handleZoomGesture: function(zoom) |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 this._cancelAnimation(); | 473 this._cancelAnimation(); |
| 474 this._cancelWindowTimesAnimation = WebInspector.animateFunction(this.ele
ment.window(), this._animateWindowTimes.bind(this), | 474 this._cancelWindowTimesAnimation = WebInspector.animateFunction(this.ele
ment.window(), this._animateWindowTimes.bind(this), |
| 475 [{from: this._timeWindowLeft, to: startTime}, {from: this._timeWindo
wRight, to: endTime}], 5, | 475 [{from: this._timeWindowLeft, to: startTime}, {from: this._timeWindo
wRight, to: endTime}], 5, |
| 476 this._animationCompleted.bind(this)); | 476 this._animationCompleted.bind(this)); |
| 477 this._pendingAnimationTimeLeft = startTime; | 477 this._pendingAnimationTimeLeft = startTime; |
| 478 this._pendingAnimationTimeRight = endTime; | 478 this._pendingAnimationTimeRight = endTime; |
| 479 }, | 479 }, |
| 480 | 480 |
| 481 __proto__: WebInspector.VBox.prototype | 481 __proto__: WebInspector.VBox.prototype |
| 482 } | 482 } |
| OLD | NEW |