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

Side by Side Diff: ui/file_manager/video_player/js/video_player.js

Issue 1457993002: VideoPlayer: VideoPlayer: Fix calculation of window size. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « third_party/closure_compiler/externs/chrome_extensions.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @param {!HTMLElement} playerContainer Main container. 6 * @param {!HTMLElement} playerContainer Main container.
7 * @param {!HTMLElement} videoContainer Container for the video element. 7 * @param {!HTMLElement} videoContainer Container for the video element.
8 * @param {!HTMLElement} controlsContainer Container for video controls. 8 * @param {!HTMLElement} controlsContainer Container for video controls.
9 * @constructor 9 * @constructor
10 * @struct 10 * @struct
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 var oldTop = window.screenY; 488 var oldTop = window.screenY;
489 var oldWidth = window.outerWidth; 489 var oldWidth = window.outerWidth;
490 var oldHeight = window.outerHeight; 490 var oldHeight = window.outerHeight;
491 491
492 if (!oldWidth && !oldHeight) { 492 if (!oldWidth && !oldHeight) {
493 oldLeft = window.screen.availWidth / 2; 493 oldLeft = window.screen.availWidth / 2;
494 oldTop = window.screen.availHeight / 2; 494 oldTop = window.screen.availHeight / 2;
495 } 495 }
496 496
497 var appWindow = chrome.app.window.current(); 497 var appWindow = chrome.app.window.current();
498 appWindow.resizeTo(newWidth, newHeight); 498 appWindow.innerBounds.width = Math.round(newWidth);
499 appWindow.moveTo(oldLeft - (newWidth - oldWidth) / 2, 499 appWindow.innerBounds.height = Math.round(newHeight);
500 oldTop - (newHeight - oldHeight) / 2); 500 appWindow.outerBounds.left = Math.round(oldLeft - (newWidth - oldWidth) / 2);
501 appWindow.outerBounds.top = Math.round(oldTop - (newHeight - oldHeight) / 2);
501 appWindow.show(); 502 appWindow.show();
502 503
503 this.videoElement_.play(); 504 this.videoElement_.play();
504 }; 505 };
505 506
506 /** 507 /**
507 * Advances to the next (or previous) track. 508 * Advances to the next (or previous) track.
508 * 509 *
509 * @param {boolean} direction True to the next, false to the previous. 510 * @param {boolean} direction True to the next, false to the previous.
510 * @private 511 * @private
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 return new Promise(function(fulfill, reject) { 692 return new Promise(function(fulfill, reject) {
692 util.URLsToEntries(window.appState.items, function(entries) { 693 util.URLsToEntries(window.appState.items, function(entries) {
693 metrics.recordOpenVideoPlayerAction(); 694 metrics.recordOpenVideoPlayerAction();
694 metrics.recordNumberOfOpenedFiles(entries.length); 695 metrics.recordNumberOfOpenedFiles(entries.length);
695 696
696 player.prepare(entries); 697 player.prepare(entries);
697 player.playFirstVideo(player, fulfill); 698 player.playFirstVideo(player, fulfill);
698 }.wrap()); 699 }.wrap());
699 }.wrap()); 700 }.wrap());
700 }.wrap()); 701 }.wrap());
OLDNEW
« no previous file with comments | « third_party/closure_compiler/externs/chrome_extensions.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698