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

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: Address comments - take 1 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 322
323 new WebInspector.DebuggerScriptMapping(WebInspector.debuggerModel, WebIn spector.workspace, WebInspector.networkWorkspaceBinding); 323 new WebInspector.DebuggerScriptMapping(WebInspector.debuggerModel, WebIn spector.workspace, WebInspector.networkWorkspaceBinding);
324 WebInspector.liveEditSupport = new WebInspector.LiveEditSupport(WebInspe ctor.workspace); 324 WebInspector.liveEditSupport = new WebInspector.LiveEditSupport(WebInspe ctor.workspace);
325 new WebInspector.CSSStyleSheetMapping(WebInspector.cssModel, WebInspecto r.workspace, WebInspector.networkWorkspaceBinding); 325 new WebInspector.CSSStyleSheetMapping(WebInspector.cssModel, WebInspecto r.workspace, WebInspector.networkWorkspaceBinding);
326 new WebInspector.PresentationConsoleMessageHelper(WebInspector.workspace ); 326 new WebInspector.PresentationConsoleMessageHelper(WebInspector.workspace );
327 327
328 // Create settings before loading modules. 328 // Create settings before loading modules.
329 WebInspector.settings.initializeBackendSettings(); 329 WebInspector.settings.initializeBackendSettings();
330 330
331 this._registerModules(); 331 this._registerModules();
332 WebInspector.KeyboardShortcut.registerActions(); 332 WebInspector.actionRegistry = new WebInspector.ActionRegistry();
333 WebInspector.KeyboardShortcut.registerBindings();
333 334
334 WebInspector.panels = {}; 335 WebInspector.panels = {};
335 WebInspector.inspectorView = new WebInspector.InspectorView(); 336 WebInspector.inspectorView = new WebInspector.InspectorView();
336 // Screencast controller creates a root view itself. 337 // Screencast controller creates a root view itself.
337 if (mainTarget.canScreencast) 338 if (mainTarget.canScreencast)
338 this._screencastController = new WebInspector.ScreencastController() ; 339 this._screencastController = new WebInspector.ScreencastController() ;
339 else 340 else
340 this._createRootView(); 341 this._createRootView();
341 this._createGlobalStatusBarItems(); 342 this._createGlobalStatusBarItems();
342 343
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 /** 659 /**
659 * @constructor 660 * @constructor
660 * @implements {WebInspector.ActionDelegate} 661 * @implements {WebInspector.ActionDelegate}
661 */ 662 */
662 WebInspector.Main.ReloadActionDelegate = function() 663 WebInspector.Main.ReloadActionDelegate = function()
663 { 664 {
664 } 665 }
665 666
666 WebInspector.Main.ReloadActionDelegate.prototype = { 667 WebInspector.Main.ReloadActionDelegate.prototype = {
667 /** 668 /**
669 * @param {!WebInspector.Context} context
668 * @return {boolean} 670 * @return {boolean}
669 */ 671 */
670 handleAction: function() 672 handleAction: function(context)
671 { 673 {
672 if (!WebInspector.Dialog.currentInstance()) { 674 if (!context.flavor(WebInspector.Dialog)) {
pfeldman 2014/04/17 10:40:25 We end up with everything checking for dialog, we
apavlov 2014/04/17 12:42:22 Done.
673 WebInspector.debuggerModel.skipAllPauses(true, true); 675 WebInspector.debuggerModel.skipAllPauses(true, true);
674 WebInspector.resourceTreeModel.reloadPage(false); 676 WebInspector.resourceTreeModel.reloadPage(false);
675 } 677 }
676 return true; 678 return true;
677 } 679 }
678 } 680 }
679 681
680 /** 682 /**
681 * @constructor 683 * @constructor
682 * @implements {WebInspector.ActionDelegate} 684 * @implements {WebInspector.ActionDelegate}
683 */ 685 */
684 WebInspector.Main.HardReloadActionDelegate = function() 686 WebInspector.Main.HardReloadActionDelegate = function()
685 { 687 {
686 } 688 }
687 689
688 WebInspector.Main.HardReloadActionDelegate.prototype = { 690 WebInspector.Main.HardReloadActionDelegate.prototype = {
689 /** 691 /**
692 * @param {!WebInspector.Context} context
690 * @return {boolean} 693 * @return {boolean}
691 */ 694 */
692 handleAction: function() 695 handleAction: function(context)
693 { 696 {
694 if (!WebInspector.Dialog.currentInstance()) { 697 if (!context.flavor(WebInspector.Dialog)) {
695 WebInspector.debuggerModel.skipAllPauses(true, true); 698 WebInspector.debuggerModel.skipAllPauses(true, true);
696 WebInspector.resourceTreeModel.reloadPage(true); 699 WebInspector.resourceTreeModel.reloadPage(true);
697 } 700 }
698 return true; 701 return true;
699 } 702 }
700 } 703 }
701 704
702 /** 705 /**
703 * @constructor 706 * @constructor
704 * @implements {WebInspector.ActionDelegate} 707 * @implements {WebInspector.ActionDelegate}
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 768
766 WebInspector.__defineGetter__("inspectedPageURL", function() 769 WebInspector.__defineGetter__("inspectedPageURL", function()
767 { 770 {
768 return WebInspector.resourceTreeModel.inspectedPageURL(); 771 return WebInspector.resourceTreeModel.inspectedPageURL();
769 }); 772 });
770 773
771 WebInspector.panel = function(name) 774 WebInspector.panel = function(name)
772 { 775 {
773 return WebInspector.inspectorView.panel(name); 776 return WebInspector.inspectorView.panel(name);
774 } 777 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698