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

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: 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..7e09190000cbf02a4ca275d661ff613c1ea9c382 100644
--- a/ui/file_manager/gallery/js/slide_mode.js
+++ b/ui/file_manager/gallery/js/slide_mode.js
@@ -607,7 +607,8 @@ 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');
yoshiki 2014/07/14 02:28:06 nit: Please fit a line within 80-columns width.
etrunko 2014/07/14 13:27:32 Done.
+ this.advanceManually(prev ? -1 : 1);
};
/**
@@ -806,10 +807,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 +820,8 @@ SlideMode.prototype.onKeyDown = function(event) {
case 'Down':
case 'Left':
case 'Right':
+ case 'MediaNextTrack':
+ case 'MediaPreviousTrack':
this.advanceWithKeyboard(keyID);
break;
}
@@ -853,6 +858,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