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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js

Issue 2680773003: DevTools: Don't trigger panel switcher shortcut if alt key is held (Closed)
Patch Set: Created 3 years, 10 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
« 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 */ 224 */
225 isDrawerMinimized() { 225 isDrawerMinimized() {
226 return this._drawerSplitWidget.isSidebarMinimized(); 226 return this._drawerSplitWidget.isSidebarMinimized();
227 } 227 }
228 228
229 /** 229 /**
230 * @param {!Event} event 230 * @param {!Event} event
231 */ 231 */
232 _keyDown(event) { 232 _keyDown(event) {
233 var keyboardEvent = /** @type {!KeyboardEvent} */ (event); 233 var keyboardEvent = /** @type {!KeyboardEvent} */ (event);
234 if (!UI.KeyboardShortcut.eventHasCtrlOrMeta(keyboardEvent)) 234 if (!UI.KeyboardShortcut.eventHasCtrlOrMeta(keyboardEvent) || event.altKey | | event.shiftKey)
pfeldman 2017/02/07 22:50:16 lgtm, but we might need to merge :(
235 return; 235 return;
236 236
237 // Ctrl/Cmd + 1-9 should show corresponding panel. 237 // Ctrl/Cmd + 1-9 should show corresponding panel.
238 var panelShortcutEnabled = Common.moduleSetting('shortcutPanelSwitch').get() ; 238 var panelShortcutEnabled = Common.moduleSetting('shortcutPanelSwitch').get() ;
239 if (panelShortcutEnabled && !event.shiftKey && !event.altKey) { 239 if (panelShortcutEnabled) {
240 var panelIndex = -1; 240 var panelIndex = -1;
241 if (event.keyCode > 0x30 && event.keyCode < 0x3A) 241 if (event.keyCode > 0x30 && event.keyCode < 0x3A)
242 panelIndex = event.keyCode - 0x31; 242 panelIndex = event.keyCode - 0x31;
243 else if ( 243 else if (
244 event.keyCode > 0x60 && event.keyCode < 0x6A && 244 event.keyCode > 0x60 && event.keyCode < 0x6A &&
245 keyboardEvent.location === KeyboardEvent.DOM_KEY_LOCATION_NUMPAD) 245 keyboardEvent.location === KeyboardEvent.DOM_KEY_LOCATION_NUMPAD)
246 panelIndex = event.keyCode - 0x61; 246 panelIndex = event.keyCode - 0x61;
247 if (panelIndex !== -1) { 247 if (panelIndex !== -1) {
248 var panelName = this._tabbedPane.allTabs()[panelIndex]; 248 var panelName = this._tabbedPane.allTabs()[panelIndex];
249 if (panelName) { 249 if (panelName) {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 * @return {boolean} 327 * @return {boolean}
328 */ 328 */
329 handleAction(context, actionId) { 329 handleAction(context, actionId) {
330 if (UI.inspectorView.drawerVisible()) 330 if (UI.inspectorView.drawerVisible())
331 UI.inspectorView._closeDrawer(); 331 UI.inspectorView._closeDrawer();
332 else 332 else
333 UI.inspectorView._showDrawer(true); 333 UI.inspectorView._showDrawer(true);
334 return true; 334 return true;
335 } 335 }
336 }; 336 };
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