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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/Main.js
diff --git a/Source/devtools/front_end/Main.js b/Source/devtools/front_end/Main.js
index 116aa455e2162832866dfdd7f50f629a2427a61d..7733acf003bbdf2eb914568faae069013dffe843 100644
--- a/Source/devtools/front_end/Main.js
+++ b/Source/devtools/front_end/Main.js
@@ -329,7 +329,8 @@ WebInspector.Main.prototype = {
WebInspector.settings.initializeBackendSettings();
this._registerModules();
- WebInspector.KeyboardShortcut.registerActions();
+ WebInspector.actionRegistry = new WebInspector.ActionRegistry();
+ WebInspector.KeyboardShortcut.registerBindings();
WebInspector.panels = {};
WebInspector.inspectorView = new WebInspector.InspectorView();
@@ -665,11 +666,12 @@ WebInspector.Main.ReloadActionDelegate = function()
WebInspector.Main.ReloadActionDelegate.prototype = {
/**
+ * @param {!WebInspector.Context} context
* @return {boolean}
*/
- handleAction: function()
+ handleAction: function(context)
{
- if (!WebInspector.Dialog.currentInstance()) {
+ 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.
WebInspector.debuggerModel.skipAllPauses(true, true);
WebInspector.resourceTreeModel.reloadPage(false);
}
@@ -687,11 +689,12 @@ WebInspector.Main.HardReloadActionDelegate = function()
WebInspector.Main.HardReloadActionDelegate.prototype = {
/**
+ * @param {!WebInspector.Context} context
* @return {boolean}
*/
- handleAction: function()
+ handleAction: function(context)
{
- if (!WebInspector.Dialog.currentInstance()) {
+ if (!context.flavor(WebInspector.Dialog)) {
WebInspector.debuggerModel.skipAllPauses(true, true);
WebInspector.resourceTreeModel.reloadPage(true);
}

Powered by Google App Engine
This is Rietveld 408576698