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

Unified Diff: chrome/browser/resources/file_manager/js/image_editor/gallery.js

Issue 9298009: Implementing full screen mode for video player in Chrome OS File Browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Copyright fix Created 8 years, 11 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
Index: chrome/browser/resources/file_manager/js/image_editor/gallery.js
diff --git a/chrome/browser/resources/file_manager/js/image_editor/gallery.js b/chrome/browser/resources/file_manager/js/image_editor/gallery.js
index e6ede82d198789092c24b9fb1c267972ed30553b..1b37be61a3d4a87b8378664a7a4c6985a853b6dc 100644
--- a/chrome/browser/resources/file_manager/js/image_editor/gallery.js
+++ b/chrome/browser/resources/file_manager/js/image_editor/gallery.js
@@ -134,8 +134,8 @@ Gallery.prototype.initDom_ = function(shareActions) {
this.mediaToolbar_.className = 'media-controls';
this.toolbar_.appendChild(this.mediaToolbar_);
- this.mediaControls_ =
- new MediaControls(this.videoElement_, this.mediaToolbar_);
+ this.mediaControls_ = new MediaControls(this.videoElement_,
+ this.mediaToolbar_, this.toggleFullscreen_.bind(this));
this.arrowBox_ = this.document_.createElement('div');
this.arrowBox_.className = 'arrow-box';
@@ -379,7 +379,22 @@ Gallery.prototype.isRenaming_ = function() {
return this.container_.hasAttribute('renaming');
};
+Gallery.prototype.toggleFullscreen_ = function() {
+ if (this.document_.webkitIsFullScreen) {
+ this.document_.webkitCancelFullScreen();
+ } else {
+ this.document_.body.webkitRequestFullScreen();
+ }
+};
+
Gallery.prototype.onClose_ = function() {
+ if (this.document_.webkitIsFullScreen) {
+ // Closing the Gallery iframe while in full screen will crash the tab.
+ this.document_.addEventListener(
+ 'webkitfullscreenchange', this.onClose_.bind(this));
+ this.document_.webkitCancelFullScreen();
+ return;
+ }
// TODO: handle write errors gracefully (suggest retry or saving elsewhere).
this.saveChanges_(this.closeCallback_);
};

Powered by Google App Engine
This is Rietveld 408576698