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