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

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

Issue 218613013: DevTools: Decouple shortcuts from actions, introduce shortcut contexts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix context-related sort order Created 6 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com).
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 327
328 new WebInspector.DebuggerScriptMapping(WebInspector.debuggerModel, WebIn spector.workspace, WebInspector.networkWorkspaceProvider); 328 new WebInspector.DebuggerScriptMapping(WebInspector.debuggerModel, WebIn spector.workspace, WebInspector.networkWorkspaceProvider);
329 WebInspector.liveEditSupport = new WebInspector.LiveEditSupport(WebInspe ctor.workspace); 329 WebInspector.liveEditSupport = new WebInspector.LiveEditSupport(WebInspe ctor.workspace);
330 new WebInspector.CSSStyleSheetMapping(WebInspector.cssModel, WebInspecto r.workspace, WebInspector.networkWorkspaceProvider); 330 new WebInspector.CSSStyleSheetMapping(WebInspector.cssModel, WebInspecto r.workspace, WebInspector.networkWorkspaceProvider);
331 new WebInspector.PresentationConsoleMessageHelper(WebInspector.workspace ); 331 new WebInspector.PresentationConsoleMessageHelper(WebInspector.workspace );
332 332
333 // Create settings before loading modules. 333 // Create settings before loading modules.
334 WebInspector.settings.initializeBackendSettings(); 334 WebInspector.settings.initializeBackendSettings();
335 335
336 this._registerModules(); 336 this._registerModules();
337 WebInspector.KeyboardShortcut.registerActions(); 337 WebInspector.moduleManager.instance(WebInspector.ActionRegistryAPI).regi sterActions();
pfeldman 2014/04/14 13:10:44 You should depend on the action system directly -
apavlov 2014/04/15 13:33:14 Done.
338 WebInspector.KeyboardShortcut.registerBindings();
338 339
339 WebInspector.panels = {}; 340 WebInspector.panels = {};
340 WebInspector.inspectorView = new WebInspector.InspectorView(); 341 WebInspector.inspectorView = new WebInspector.InspectorView();
341 // Screencast controller creates a root view itself. 342 // Screencast controller creates a root view itself.
342 if (mainTarget.canScreencast) 343 if (mainTarget.canScreencast)
343 this._screencastController = new WebInspector.ScreencastController() ; 344 this._screencastController = new WebInspector.ScreencastController() ;
344 else 345 else
345 this._createRootView(); 346 this._createRootView();
346 this._createGlobalStatusBarItems(); 347 this._createGlobalStatusBarItems();
347 348
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 if (!WebInspector.Dialog.currentInstance() && WebInspector.inspectElemen tModeController && WebInspector.inspectElementModeController.handleShortcut(even t)) 534 if (!WebInspector.Dialog.currentInstance() && WebInspector.inspectElemen tModeController && WebInspector.inspectElementModeController.handleShortcut(even t))
534 return; 535 return;
535 536
536 var isValidZoomShortcut = WebInspector.KeyboardShortcut.eventHasCtrlOrMe ta(event) && 537 var isValidZoomShortcut = WebInspector.KeyboardShortcut.eventHasCtrlOrMe ta(event) &&
537 !event.altKey && 538 !event.altKey &&
538 !InspectorFrontendHost.isStub; 539 !InspectorFrontendHost.isStub;
539 if (!WebInspector.Dialog.currentInstance() && isValidZoomShortcut && thi s._handleZoomEvent(event)) { 540 if (!WebInspector.Dialog.currentInstance() && isValidZoomShortcut && thi s._handleZoomEvent(event)) {
540 event.consume(true); 541 event.consume(true);
541 return; 542 return;
542 } 543 }
543 WebInspector.KeyboardShortcut.handleShortcut(event); 544 WebInspector.KeyboardShortcut.handleShortcut(event, WebInspector.inspect orView.currentPanelId() || "");
544 }, 545 },
545 546
546 _documentCanCopy: function(event) 547 _documentCanCopy: function(event)
547 { 548 {
548 if (WebInspector.inspectorView.currentPanel() && WebInspector.inspectorV iew.currentPanel()["handleCopyEvent"]) 549 if (WebInspector.inspectorView.currentPanel() && WebInspector.inspectorV iew.currentPanel()["handleCopyEvent"])
549 event.preventDefault(); 550 event.preventDefault();
550 }, 551 },
551 552
552 _documentCopy: function(event) 553 _documentCopy: function(event)
553 { 554 {
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 768
768 WebInspector.__defineGetter__("inspectedPageURL", function() 769 WebInspector.__defineGetter__("inspectedPageURL", function()
769 { 770 {
770 return WebInspector.resourceTreeModel.inspectedPageURL(); 771 return WebInspector.resourceTreeModel.inspectedPageURL();
771 }); 772 });
772 773
773 WebInspector.panel = function(name) 774 WebInspector.panel = function(name)
774 { 775 {
775 return WebInspector.inspectorView.panel(name); 776 return WebInspector.inspectorView.panel(name);
776 } 777 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698