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

Unified Diff: Source/devtools/front_end/ui/ShortcutRegistry.js

Issue 655273002: DevTools: zoom is broken in hosted mode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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
« no previous file with comments | « Source/devtools/front_end/ui/ActionRegistry.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/ShortcutRegistry.js
diff --git a/Source/devtools/front_end/ui/ShortcutRegistry.js b/Source/devtools/front_end/ui/ShortcutRegistry.js
index b603e89e80f41becd2f8ccfa18699dea2b1ab550..89b00d2ace2a0473897b3571cb707c180d6a77c7 100644
--- a/Source/devtools/front_end/ui/ShortcutRegistry.js
+++ b/Source/devtools/front_end/ui/ShortcutRegistry.js
@@ -97,13 +97,34 @@ WebInspector.ShortcutRegistry.prototype = {
return;
}
- for (var i = 0; i < actionIds.length; ++i) {
- if (!isPossiblyInputKey()) {
- if (handler.call(this, actionIds[i]))
- break;
- } else {
- this._pendingActionTimer = setTimeout(handler.bind(this, actionIds[i]), 0);
- break;
+ if (!isPossiblyInputKey())
+ processActionIdsSequentially.call(this);
+ else
+ this._pendingActionTimer = setTimeout(processActionIdsSequentially.bind(this), 0);
+
+ /**
+ * @this {WebInspector.ShortcutRegistry}
+ */
+ function processActionIdsSequentially()
+ {
+ delete this._pendingActionTimer;
+ var actionId = actionIds.shift();
+ if (!actionId)
+ return;
+
+ this._actionRegistry.execute(actionId).then(continueIfNecessary.bind(this));
+
+ /**
+ * @this {WebInspector.ShortcutRegistry}
+ */
+ function continueIfNecessary(result)
+ {
+ if (result) {
+ if (event)
+ event.consume(true);
dgozman 2014/10/16 10:28:17 How does this work when consuming event asynchrono
dgozman 2014/10/16 10:41:16 Let's comment about "best effort" you are doing he
pfeldman 2014/10/16 10:46:46 Acknowledged.
pfeldman 2014/10/16 10:46:47 Done.
+ return;
+ }
+ return processActionIdsSequentially.call(this);
dgozman 2014/10/16 10:28:17 nit: processActionIdsSequentially does not return
pfeldman 2014/10/16 10:46:47 It actually does return a Promise.<undefined> that
pfeldman 2014/10/16 10:56:49 nm, you are right.
}
}
@@ -133,20 +154,6 @@ WebInspector.ShortcutRegistry.prototype = {
{
return !!(keyModifiers & mod);
}
-
- /**
- * @param {string} actionId
- * @return {boolean}
- * @this {WebInspector.ShortcutRegistry}
- */
- function handler(actionId)
- {
- var result = this._actionRegistry.execute(actionId);
- if (result && event)
- event.consume(true);
- delete this._pendingActionTimer;
- return result;
- }
},
/**
« no previous file with comments | « Source/devtools/front_end/ui/ActionRegistry.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698