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

Side by Side Diff: Source/devtools/front_end/KeyboardShortcut.js

Issue 212573006: DevTools: Implement batch event forwarding from extension panels (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | « Source/devtools/front_end/ExtensionServer.js ('k') | 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 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Google Inc. All rights reserved. 3 * Copyright (C) 2009 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 { 140 {
141 var modifiers = WebInspector.KeyboardShortcut.Modifiers.None; 141 var modifiers = WebInspector.KeyboardShortcut.Modifiers.None;
142 if (keyboardEvent.shiftKey) 142 if (keyboardEvent.shiftKey)
143 modifiers |= WebInspector.KeyboardShortcut.Modifiers.Shift; 143 modifiers |= WebInspector.KeyboardShortcut.Modifiers.Shift;
144 if (keyboardEvent.ctrlKey) 144 if (keyboardEvent.ctrlKey)
145 modifiers |= WebInspector.KeyboardShortcut.Modifiers.Ctrl; 145 modifiers |= WebInspector.KeyboardShortcut.Modifiers.Ctrl;
146 if (keyboardEvent.altKey) 146 if (keyboardEvent.altKey)
147 modifiers |= WebInspector.KeyboardShortcut.Modifiers.Alt; 147 modifiers |= WebInspector.KeyboardShortcut.Modifiers.Alt;
148 if (keyboardEvent.metaKey) 148 if (keyboardEvent.metaKey)
149 modifiers |= WebInspector.KeyboardShortcut.Modifiers.Meta; 149 modifiers |= WebInspector.KeyboardShortcut.Modifiers.Meta;
150 return WebInspector.KeyboardShortcut._makeKeyFromCodeAndModifiers(keyboardEv ent.keyCode, modifiers); 150
151 function keyCodeForEvent(keyboardEvent)
152 {
153 // Use either a real or a synthetic keyCode (for events originating from extensions).
154 return keyboardEvent.keyCode || keyboardEvent["__keyCode"];
155 }
156 return WebInspector.KeyboardShortcut._makeKeyFromCodeAndModifiers(keyCodeFor Event(keyboardEvent), modifiers);
151 } 157 }
152 158
153 /** 159 /**
154 * @param {?KeyboardEvent} event 160 * @param {?KeyboardEvent} event
155 * @return {boolean} 161 * @return {boolean}
156 */ 162 */
157 WebInspector.KeyboardShortcut.eventHasCtrlOrMeta = function(event) 163 WebInspector.KeyboardShortcut.eventHasCtrlOrMeta = function(event)
158 { 164 {
159 return WebInspector.isMac() ? event.metaKey && !event.ctrlKey : event.ctrlKe y && !event.metaKey; 165 return WebInspector.isMac() ? event.metaKey && !event.ctrlKey : event.ctrlKe y && !event.metaKey;
160 } 166 }
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 if (!platformsString) 361 if (!platformsString)
356 return true; 362 return true;
357 var platforms = platformsString.split(","); 363 var platforms = platformsString.split(",");
358 var isMatch = false; 364 var isMatch = false;
359 var currentPlatform = WebInspector.platform(); 365 var currentPlatform = WebInspector.platform();
360 for (var i = 0; !isMatch && i < platforms.length; ++i) 366 for (var i = 0; !isMatch && i < platforms.length; ++i)
361 isMatch = platforms[i] === currentPlatform; 367 isMatch = platforms[i] === currentPlatform;
362 return isMatch; 368 return isMatch;
363 } 369 }
364 } 370 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/ExtensionServer.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698