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

Unified Diff: ui/file_manager/video_player/js/video_player.js

Issue 315103004: Video Player: Supports bound arguments of wrap() util function (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed the comments & Added missing wrap() Created 6 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 | « ui/file_manager/video_player/js/error_util.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/video_player/js/video_player.js
diff --git a/ui/file_manager/video_player/js/video_player.js b/ui/file_manager/video_player/js/video_player.js
index 9794215638e53f8668189da8f61d3d71aea19f9d..23524bf6f363f923c3fbcf47778d9c2322369b68 100644
--- a/ui/file_manager/video_player/js/video_player.js
+++ b/ui/file_manager/video_player/js/video_player.js
@@ -51,7 +51,7 @@ function FullWindowVideoControls(
this.inactivityWatcher_ = new MouseInactivityWatcher(playerContainer);
this.__defineGetter__('inactivityWatcher', function() {
return this.inactivityWatcher_;
- });
+ }.wrap(this));
this.inactivityWatcher_.check();
}
@@ -126,11 +126,11 @@ VideoPlayer.prototype = {
* @param {Array.<Object.<string, Object>>} videos List of videos.
*/
VideoPlayer.prototype.prepare = function(videos) {
- document.ondragstart = function(e) { e.preventDefault() };
-
this.videos_ = videos;
- var preventDefault = function(event) { event.preventDefault(); };
+ var preventDefault = function(event) { event.preventDefault(); }.wrap(null);
+
+ document.ondragstart = preventDefault;
var maximizeButton = document.querySelector('.maximize-button');
maximizeButton.addEventListener(
@@ -141,7 +141,7 @@ VideoPlayer.prototype.prepare = function(videos) {
appWindow.restore();
else
appWindow.maximize();
- });
+ }.wrap(null));
maximizeButton.addEventListener('mousedown', preventDefault);
var minimizeButton = document.querySelector('.minimize-button');
@@ -149,13 +149,13 @@ VideoPlayer.prototype.prepare = function(videos) {
'click',
function() {
chrome.app.window.current().minimize()
- });
+ }.wrap(null));
minimizeButton.addEventListener('mousedown', preventDefault);
var closeButton = document.querySelector('.close-button');
closeButton.addEventListener(
'click',
- function() { close(); });
+ function() { close(); }.wrap(null));
closeButton.addEventListener('mousedown', preventDefault);
this.controls_ = new FullWindowVideoControls(
@@ -302,7 +302,7 @@ function initVideos(callback) {
var videos = window.videos;
window.videos = null;
callback(videos);
- });
+ }.wrap(null));
}
var player = new VideoPlayer();
@@ -315,7 +315,7 @@ function initStrings(callback) {
chrome.fileBrowserPrivate.getStrings(function(strings) {
loadTimeData.data = strings;
callback();
- });
+ }.wrap(null));
}
var initPromise = Promise.all(
@@ -327,4 +327,4 @@ initPromise.then(function(results) {
var videos = results[0];
player.prepare(videos);
return new Promise(player.playVideo.wrap(player));
-});
+}.wrap(null));
« no previous file with comments | « ui/file_manager/video_player/js/error_util.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698