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

Unified Diff: ui/file_manager/gallery/js/slide_mode.js

Issue 385263005: Gallery: Add support for Media Keys (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adjust to 80 columns as suggested Created 6 years, 5 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 | « ui/file_manager/gallery/js/gallery.js ('k') | ui/webui/resources/js/cr/ui/list_selection_controller.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/gallery/js/slide_mode.js
diff --git a/ui/file_manager/gallery/js/slide_mode.js b/ui/file_manager/gallery/js/slide_mode.js
index d0c04b662a8e3ba47aeb98a7d232c4a87d8585a9..ba445f03b893a1a404d174197a214c9f5d182614 100644
--- a/ui/file_manager/gallery/js/slide_mode.js
+++ b/ui/file_manager/gallery/js/slide_mode.js
@@ -607,7 +607,10 @@ SlideMode.prototype.getNextSelectedIndex_ = function(direction) {
* @param {string} keyID Key identifier.
*/
SlideMode.prototype.advanceWithKeyboard = function(keyID) {
- this.advanceManually(keyID === 'Up' || keyID === 'Left' ? -1 : 1);
+ var prev = (keyID === 'Up' ||
+ keyID === 'Left' ||
+ keyID === 'MediaPreviousTrack');
+ this.advanceManually(prev ? -1 : 1);
};
/**
@@ -806,10 +809,12 @@ SlideMode.prototype.onKeyDown = function(event) {
if (this.isSlideshowOn_()) {
switch (keyID) {
case 'U+001B': // Escape exits the slideshow.
+ case 'MediaStop':
this.stopSlideshow_(event);
break;
case 'U+0020': // Space pauses/resumes the slideshow.
+ case 'MediaPlayPause':
this.toggleSlideshowPause_();
break;
@@ -817,6 +822,8 @@ SlideMode.prototype.onKeyDown = function(event) {
case 'Down':
case 'Left':
case 'Right':
+ case 'MediaNextTrack':
+ case 'MediaPreviousTrack':
this.advanceWithKeyboard(keyID);
break;
}
@@ -853,6 +860,8 @@ SlideMode.prototype.onKeyDown = function(event) {
case 'Down':
case 'Left':
case 'Right':
+ case 'MediaNextTrack':
+ case 'MediaPreviousTrack':
this.advanceWithKeyboard(keyID);
break;
« no previous file with comments | « ui/file_manager/gallery/js/gallery.js ('k') | ui/webui/resources/js/cr/ui/list_selection_controller.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698