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

Unified Diff: ui/file_manager/audio_player/js/audio_player.js

Issue 1161393003: Media player: Add shortcut keys (Ctrl+Shift+I/J/C/B) to media players for debug. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | ui/file_manager/video_player/js/video_player.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/audio_player/js/audio_player.js
diff --git a/ui/file_manager/audio_player/js/audio_player.js b/ui/file_manager/audio_player/js/audio_player.js
index a00929193a904480abad9b7a9b6579a9ed8576f7..1646ff1a135ab8395234f4aed7f98fceea8b38f0 100644
--- a/ui/file_manager/audio_player/js/audio_player.js
+++ b/ui/file_manager/audio_player/js/audio_player.js
@@ -67,6 +67,7 @@ function AudioPlayer(container) {
this.onExternallyUnmounted_.bind(this));
window.addEventListener('resize', this.onResize_.bind(this));
+ document.addEventListener('keydown', this.onKeyDown_.bind(this));
// Show the window after DOM is processed.
var currentWindow = chrome.app.window.current();
@@ -291,6 +292,30 @@ AudioPlayer.prototype.onResize_ = function(event) {
}
};
+/**
+ * Handles keydown event to open inspector with shortcut keys.
+ *
+ * @param {Event} event KeyDown event.
+ * @private
+ */
+AudioPlayer.prototype.onKeyDown_ = function(event) {
+ switch (util.getKeyModifiers(event) + event.keyIdentifier) {
+ // Handle debug shortcut keys.
+ case 'Ctrl-Shift-U+0049': // Ctrl+Shift+I
+ chrome.fileManagerPrivate.openInspector('normal');
+ break;
+ case 'Ctrl-Shift-U+004A': // Ctrl+Shift+J
+ chrome.fileManagerPrivate.openInspector('console');
+ break;
+ case 'Ctrl-Shift-U+0043': // Ctrl+Shift+C
+ chrome.fileManagerPrivate.openInspector('element');
+ break;
+ case 'Ctrl-Shift-U+0042': // Ctrl+Shift+B
+ chrome.fileManagerPrivate.openInspector('background');
+ break;
+ }
+};
+
/* Keep the below constants in sync with the CSS. */
/**
« no previous file with comments | « no previous file | ui/file_manager/video_player/js/video_player.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698