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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui_lazy/ChartViewport.js

Issue 2431773002: DevTools: Make Timeline navigation keyboard layout agnostic (WASD/ZQSD) (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js ('k') | 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 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
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
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 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698