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

Unified Diff: Source/devtools/front_end/host/InspectorFrontendHost.js

Issue 670303002: DevTools: fix Ctrl-Plus/Ctrl-Minus shortcuts for zooming in hosted mode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: renaming Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 = {
« 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