| OLD | NEW |
| 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 15 matching lines...) Expand all Loading... |
| 26 var currentWindow = chrome.app.window.current(); | 26 var currentWindow = chrome.app.window.current(); |
| 27 currentWindow.onFullscreened.addListener( | 27 currentWindow.onFullscreened.addListener( |
| 28 this.onFullScreenChanged.bind(this, true)); | 28 this.onFullScreenChanged.bind(this, true)); |
| 29 currentWindow.onRestored.addListener( | 29 currentWindow.onRestored.addListener( |
| 30 this.onFullScreenChanged.bind(this, false)); | 30 this.onFullScreenChanged.bind(this, false)); |
| 31 document.addEventListener('keydown', function(e) { | 31 document.addEventListener('keydown', function(e) { |
| 32 this.inactivityWatcher_.kick(); | 32 this.inactivityWatcher_.kick(); |
| 33 switch (util.getKeyModifiers(e) + e.key) { | 33 switch (util.getKeyModifiers(e) + e.key) { |
| 34 // Handle debug shortcut keys. | 34 // Handle debug shortcut keys. |
| 35 case 'Ctrl-Shift-I': // Ctrl+Shift+I | 35 case 'Ctrl-Shift-I': // Ctrl+Shift+I |
| 36 chrome.fileManagerPrivate.openInspector('normal'); | 36 chrome.fileManagerPrivate.openInspector( |
| 37 chrome.fileManagerPrivate.InspectionType.NORMAL); |
| 37 break; | 38 break; |
| 38 case 'Ctrl-Shift-J': // Ctrl+Shift+J | 39 case 'Ctrl-Shift-J': // Ctrl+Shift+J |
| 39 chrome.fileManagerPrivate.openInspector('console'); | 40 chrome.fileManagerPrivate.openInspector( |
| 41 chrome.fileManagerPrivate.InspectionType.CONSOLE); |
| 40 break; | 42 break; |
| 41 case 'Ctrl-Shift-C': // Ctrl+Shift+C | 43 case 'Ctrl-Shift-C': // Ctrl+Shift+C |
| 42 chrome.fileManagerPrivate.openInspector('element'); | 44 chrome.fileManagerPrivate.openInspector( |
| 45 chrome.fileManagerPrivate.InspectionType.ELEMENT); |
| 43 break; | 46 break; |
| 44 case 'Ctrl-Shift-B': // Ctrl+Shift+B | 47 case 'Ctrl-Shift-B': // Ctrl+Shift+B |
| 45 chrome.fileManagerPrivate.openInspector('background'); | 48 chrome.fileManagerPrivate.openInspector( |
| 49 chrome.fileManagerPrivate.InspectionType.BACKGROUND); |
| 46 break; | 50 break; |
| 47 | 51 |
| 48 case ' ': // Space | 52 case ' ': // Space |
| 49 case 'k': | 53 case 'k': |
| 50 case 'MediaPlayPause': | 54 case 'MediaPlayPause': |
| 51 if (!e.target.classList.contains('menu-button')) | 55 if (!e.target.classList.contains('menu-button')) |
| 52 this.togglePlayStateWithFeedback(); | 56 this.togglePlayStateWithFeedback(); |
| 53 break; | 57 break; |
| 54 case 'Escape': | 58 case 'Escape': |
| 55 util.toggleFullScreen( | 59 util.toggleFullScreen( |
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 return new Promise(function(fulfill, reject) { | 817 return new Promise(function(fulfill, reject) { |
| 814 util.URLsToEntries(window.appState.items, function(entries) { | 818 util.URLsToEntries(window.appState.items, function(entries) { |
| 815 metrics.recordOpenVideoPlayerAction(); | 819 metrics.recordOpenVideoPlayerAction(); |
| 816 metrics.recordNumberOfOpenedFiles(entries.length); | 820 metrics.recordNumberOfOpenedFiles(entries.length); |
| 817 | 821 |
| 818 player.prepare(entries); | 822 player.prepare(entries); |
| 819 player.playFirstVideo(player, fulfill); | 823 player.playFirstVideo(player, fulfill); |
| 820 }.wrap()); | 824 }.wrap()); |
| 821 }.wrap()); | 825 }.wrap()); |
| 822 }.wrap()); | 826 }.wrap()); |
| OLD | NEW |