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

Side by Side Diff: Source/devtools/front_end/profiler/ProfilesPanel.js

Issue 1313443005: DevTools: forward Up/Down keys to profiles sidebar from FlameChart (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: new approach 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 | Source/devtools/front_end/ui/treeoutline.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 for (var i = 0; i < types.length; i++) 485 for (var i = 0; i < types.length; i++)
486 this._registerProfileType(types[i]); 486 this._registerProfileType(types[i]);
487 this._launcherView.restoreSelectedProfileType(); 487 this._launcherView.restoreSelectedProfileType();
488 this.profilesItemTreeElement.select(); 488 this.profilesItemTreeElement.select();
489 this._showLauncherView(); 489 this._showLauncherView();
490 490
491 this._createFileSelectorElement(); 491 this._createFileSelectorElement();
492 this.element.addEventListener("contextmenu", this._handleContextMenuEvent.bi nd(this), true); 492 this.element.addEventListener("contextmenu", this._handleContextMenuEvent.bi nd(this), true);
493 this._registerShortcuts(); 493 this._registerShortcuts();
494 494
495 this.contentElement.addEventListener("keydown", this._onKeyDown.bind(this), false);
496
495 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event s.SuspendStateChanged, this._onSuspendStateChanged, this); 497 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event s.SuspendStateChanged, this._onSuspendStateChanged, this);
496 } 498 }
497 499
498 WebInspector.ProfilesPanel.prototype = { 500 WebInspector.ProfilesPanel.prototype = {
499 /** 501 /**
502 * @param {!Event} event
503 */
504 _onKeyDown: function(event)
505 {
506 var handled = false;
507 if (event.keyIdentifier === "Down" && !event.altKey)
508 handled = this._sidebarTree.selectNext();
509 else if (event.keyIdentifier === "Up" && !event.altKey)
510 handled = this._sidebarTree.selectPrevious();
511 if (handled)
512 event.consume(true);
513 },
514
515 /**
500 * @override 516 * @override
501 * @return {?WebInspector.SearchableView} 517 * @return {?WebInspector.SearchableView}
502 */ 518 */
503 searchableView: function() 519 searchableView: function()
504 { 520 {
505 return this.visibleView && this.visibleView.searchableView ? this.visibl eView.searchableView() : null; 521 return this.visibleView && this.visibleView.searchableView ? this.visibl eView.searchableView() : null;
506 }, 522 },
507 523
508 _createFileSelectorElement: function() 524 _createFileSelectorElement: function()
509 { 525 {
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
1262 WebInspector.ProfilesPanelFactory.prototype = { 1278 WebInspector.ProfilesPanelFactory.prototype = {
1263 /** 1279 /**
1264 * @override 1280 * @override
1265 * @return {!WebInspector.Panel} 1281 * @return {!WebInspector.Panel}
1266 */ 1282 */
1267 createPanel: function() 1283 createPanel: function()
1268 { 1284 {
1269 return WebInspector.ProfilesPanel._instance(); 1285 return WebInspector.ProfilesPanel._instance();
1270 } 1286 }
1271 } 1287 }
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/ui/treeoutline.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698