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

Side by Side Diff: Source/devtools/front_end/ui/ShortcutRegistry.js

Issue 403523005: DevTools: Consume registered DevTools shortcuts so that they don't trigger default behavior. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 * @param {!WebInspector.ActionRegistry} actionRegistry 7 * @param {!WebInspector.ActionRegistry} actionRegistry
8 */ 8 */
9 WebInspector.ShortcutRegistry = function(actionRegistry) 9 WebInspector.ShortcutRegistry = function(actionRegistry)
10 { 10 {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 this.handleKey(WebInspector.KeyboardShortcut.makeKeyFromEvent(event), ev ent.keyIdentifier, event); 82 this.handleKey(WebInspector.KeyboardShortcut.makeKeyFromEvent(event), ev ent.keyIdentifier, event);
83 }, 83 },
84 84
85 /** 85 /**
86 * @param {number} key 86 * @param {number} key
87 * @param {string} keyIdentifier 87 * @param {string} keyIdentifier
88 * @param {!KeyboardEvent=} event 88 * @param {!KeyboardEvent=} event
89 */ 89 */
90 handleKey: function(key, keyIdentifier, event) 90 handleKey: function(key, keyIdentifier, event)
91 { 91 {
92 var keyModifiers = key >> 8;
92 var actionIds = this.applicableActions(key); 93 var actionIds = this.applicableActions(key);
93 if (WebInspector.GlassPane.DefaultFocusedViewStack.length > 1) { 94 if (WebInspector.GlassPane.DefaultFocusedViewStack.length > 1) {
94 if (actionIds.length && !isPossiblyInputKey()) 95 if (actionIds.length && !isPossiblyInputKey())
95 event.consume(true); 96 event.consume(true);
96 return; 97 return;
97 } 98 }
98 99
99 for (var i = 0; i < actionIds.length; ++i) { 100 for (var i = 0; i < actionIds.length; ++i) {
100 var keyModifiers = key >> 8;
101 if (!isPossiblyInputKey()) { 101 if (!isPossiblyInputKey()) {
102 if (handler.call(this, actionIds[i])) 102 if (handler.call(this, actionIds[i]))
103 break; 103 break;
104 } else { 104 } else {
105 this._pendingActionTimer = setTimeout(handler.bind(this, actionI ds[i]), 0); 105 this._pendingActionTimer = setTimeout(handler.bind(this, actionI ds[i]), 0);
106 break; 106 break;
107 } 107 }
108 } 108 }
109 109
110 /** 110 /**
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 * @constructor 217 * @constructor
218 */ 218 */
219 WebInspector.ShortcutRegistry.ForwardedShortcut = function() 219 WebInspector.ShortcutRegistry.ForwardedShortcut = function()
220 { 220 {
221 } 221 }
222 222
223 WebInspector.ShortcutRegistry.ForwardedShortcut.instance = new WebInspector.Shor tcutRegistry.ForwardedShortcut(); 223 WebInspector.ShortcutRegistry.ForwardedShortcut.instance = new WebInspector.Shor tcutRegistry.ForwardedShortcut();
224 224
225 /** @type {!WebInspector.ShortcutRegistry} */ 225 /** @type {!WebInspector.ShortcutRegistry} */
226 WebInspector.shortcutRegistry; 226 WebInspector.shortcutRegistry;
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