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

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

Issue 9288062: Adding fullscreen mode access to chrome.fileBrowserPrivate API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/media_controls.js
diff --git a/chrome/browser/resources/file_manager/js/image_editor/media_controls.js b/chrome/browser/resources/file_manager/js/image_editor/media_controls.js
index 61406659ba2393705d262421ea74fd20e3a0ba9e..264ae657a04617d304e90b1f30e83979ffe691df 100644
--- a/chrome/browser/resources/file_manager/js/image_editor/media_controls.js
+++ b/chrome/browser/resources/file_manager/js/image_editor/media_controls.js
@@ -20,6 +20,9 @@ function MediaControls(mediaElement, containerElement) {
this.setupPlaybackControls_();
this.setupMediaEvents_();
+
+ this.document_.defaultView.addEventListener(
+ 'resize', this.onWindowResize.bind(this));
}
/**
@@ -279,8 +282,28 @@ MediaControls.prototype.onVolumeMouseDown_ = function () {
};
MediaControls.prototype.onFullscreenButtonClick_ = function() {
- this.fullscreenButton_.classList.toggle('on');
- // TODO: invoke the actual full screen mode
+ if (chrome.fileBrowserPrivate) {
+ chrome.fileBrowserPrivate.toggleFullscreen();
+ }
+};
+
+MediaControls.prototype.onWindowResize = function() {
+ // There is no notification to tell us when the user enters/leaves the
+ // fullscreen mode using the built-in Chrome controls. All we can do is
+ // query the current fullscreen state.
+ // The best place to do it is a window resize handler.
+ if (chrome.fileBrowserPrivate) {
+ chrome.fileBrowserPrivate.isFullscreen(
+ this.updateFullscreenStatus_.bind(this));
+ }
+};
+
+MediaControls.prototype.updateFullscreenStatus_ = function(on) {
+ if (on) {
+ this.fullscreenButton_.classList.add('on');
+ } else {
+ this.fullscreenButton_.classList.remove('on');
+ }
};
/**
« no previous file with comments | « chrome/browser/extensions/extension_function_dispatcher.cc ('k') | chrome/common/extensions/api/fileBrowserPrivate.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698