Chromium Code Reviews| Index: Source/devtools/front_end/host/InspectorFrontendHost.js |
| diff --git a/Source/devtools/front_end/host/InspectorFrontendHost.js b/Source/devtools/front_end/host/InspectorFrontendHost.js |
| index 00c50e304fbabe81c25a3c82222b247defa207af..16332cf37617fc086e097c48b20ddde3e7ff704e 100644 |
| --- a/Source/devtools/front_end/host/InspectorFrontendHost.js |
| +++ b/Source/devtools/front_end/host/InspectorFrontendHost.js |
| @@ -299,6 +299,19 @@ InspectorFrontendHostAPI.prototype = { |
| */ |
| WebInspector.InspectorFrontendHostStub = function() |
| { |
| + /** |
| + * @param {!Event} event |
| + */ |
| + function stopEventPropagation(event) |
| + { |
| + // Let browser handle Ctrl+/Ctrl- shortcuts in hosted mode. |
| + var zoomInKey = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.Keys.Plus.code, WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta); |
|
pfeldman
2014/10/23 12:24:13
Are you absolutely sure you want all this code to
|
| + var zoomOutKey = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.Keys.Minus.code, WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta); |
| + var key = WebInspector.KeyboardShortcut.makeKeyFromEvent(event); |
| + if (key === zoomInKey || key === zoomOutKey) |
| + event.stopPropagation(); |
| + } |
| + document.addEventListener("keydown", stopEventPropagation, true); |
| } |
| WebInspector.InspectorFrontendHostStub.prototype = { |