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

Unified Diff: chrome/browser/resources/file_manager/js/util.js

Issue 9567003: Prevented default backspace handler in File Browser Gallery (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/file_manager/js/image_editor/image_editor.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/js/util.js
diff --git a/chrome/browser/resources/file_manager/js/util.js b/chrome/browser/resources/file_manager/js/util.js
index 40c38ce390d284720efc37f35fced7b80b4ef25e..18fd9926c907d0a317381966849b4f74fd2447fb 100644
--- a/chrome/browser/resources/file_manager/js/util.js
+++ b/chrome/browser/resources/file_manager/js/util.js
@@ -474,5 +474,19 @@ var util = {
}
return element;
+ },
+
+ /**
+ * Returns a string '[Ctrl-][Alt-][Shift-][Meta-]' depending on the event
+ * modifiers. Convenient for writing out conditions in keyboard handlers.
+ *
+ * @param {Event} event
+ * @return {string}
+ */
+ getKeyModifiers: function(event) {
+ return (event.ctrlKey ? 'Ctrl-' : '') +
+ (event.altKey ? 'Alt-' : '') +
+ (event.shiftKey ? 'Shift-' : '') +
+ (event.metaKey ? 'Meta-' : '');
}
};
« no previous file with comments | « chrome/browser/resources/file_manager/js/image_editor/image_editor.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698