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

Side by Side 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 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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 */ 292 */
293 isHostedMode: function() { } 293 isHostedMode: function() { }
294 } 294 }
295 295
296 /** 296 /**
297 * @constructor 297 * @constructor
298 * @implements {InspectorFrontendHostAPI} 298 * @implements {InspectorFrontendHostAPI}
299 */ 299 */
300 WebInspector.InspectorFrontendHostStub = function() 300 WebInspector.InspectorFrontendHostStub = function()
301 { 301 {
302 /**
303 * @param {!Event} event
304 */
305 function stopEventPropagation(event)
306 {
307 // Let browser handle Ctrl+/Ctrl- shortcuts in hosted mode.
308 var zoomInKey = WebInspector.KeyboardShortcut.makeKey(WebInspector.Keybo ardShortcut.Keys.Plus.code, WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta);
pfeldman 2014/10/23 12:24:13 Are you absolutely sure you want all this code to
309 var zoomOutKey = WebInspector.KeyboardShortcut.makeKey(WebInspector.Keyb oardShortcut.Keys.Minus.code, WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta );
310 var key = WebInspector.KeyboardShortcut.makeKeyFromEvent(event);
311 if (key === zoomInKey || key === zoomOutKey)
312 event.stopPropagation();
313 }
314 document.addEventListener("keydown", stopEventPropagation, true);
302 } 315 }
303 316
304 WebInspector.InspectorFrontendHostStub.prototype = { 317 WebInspector.InspectorFrontendHostStub.prototype = {
305 /** 318 /**
306 * @return {string} 319 * @return {string}
307 */ 320 */
308 getSelectionBackgroundColor: function() 321 getSelectionBackgroundColor: function()
309 { 322 {
310 return "#6e86ff"; 323 return "#6e86ff";
311 }, 324 },
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 * @param {number} id 703 * @param {number} id
691 * @param {?string} error 704 * @param {?string} error
692 */ 705 */
693 embedderMessageAck: function(id, error) 706 embedderMessageAck: function(id, error)
694 { 707 {
695 InspectorFrontendHost["embedderMessageAck"](id, error); 708 InspectorFrontendHost["embedderMessageAck"](id, error);
696 } 709 }
697 } 710 }
698 711
699 var InspectorFrontendAPI = new InspectorFrontendAPIImpl(); 712 var InspectorFrontendAPI = new InspectorFrontendAPIImpl();
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