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 fd80c428bd7a99c15a2d02897ecd5b7352b5c695..35a4301398d1ea5de95df3c017842315683d5d22 100644 |
--- a/ui/file_manager/gallery/js/slide_mode.js |
+++ b/ui/file_manager/gallery/js/slide_mode.js |
@@ -203,6 +203,7 @@ |
*/ |
this.spinnerTimer_ = null; |
+ this.context_.appWindow.onRestored.addListener(this.onRestored_.bind(this)); |
window.addEventListener('resize', this.onResize_.bind(this)); |
// ---------------------------------------------------------------- |
@@ -1108,7 +1109,9 @@ |
if (this.isSlideshowOn_()) { |
switch (keyID) { |
- case 'U+001B': // Escape |
+ // Escape key is captured by the platform to exit full screen. We handle |
+ // it by onRestored event. |
+ |
case 'MediaStop': |
this.stopSlideshow_(event); |
break; |
@@ -1213,6 +1216,17 @@ |
}; |
/** |
+ * Restored event handler. |
+ * @private |
+ */ |
+SlideMode.prototype.onRestored_ = function() { |
+ // Leave slide show since the window should not be in full screen when |
+ // onRestored event is dispatched. |
+ if (this.isSlideshowOn_()) |
+ this.stopSlideshow_(); |
+}; |
+ |
+/** |
* Resize handler. |
* @private |
*/ |