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

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

Issue 1174733005: Revert of Gallery: capture escape key in full screen by adding a permission. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/gallery/manifest.json » ('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 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
*/
« no previous file with comments | « no previous file | ui/file_manager/gallery/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698