Commit 0709f3d4 authored by Julian Watson's avatar Julian Watson Committed by Commit Bot

file_manager: fix linting errors

Bug: 778674
Test: autoninja -C out/Release ui/file_manager:closure_compile
Test: autoninja -C out/Release browser_tests && out/Release/browser_tests --gtest_filter=*/FilesApp*
Change-Id: I1a9e532afc0122a78328eae857e0dbf34971fcbf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2212015
Commit-Queue: Julian Watson <juwa@google.com>
Auto-Submit: Julian Watson <juwa@google.com>
Reviewed-by: default avatarFrançois Degros <fdegros@chromium.org>
Cr-Commit-Position: refs/heads/master@{#771492}
parent bc5da8c9
...@@ -59,26 +59,23 @@ function AudioPlayer(container) { ...@@ -59,26 +59,23 @@ function AudioPlayer(container) {
// Restore the saved state from local storage, and update the local storage // Restore the saved state from local storage, and update the local storage
// if the states are changed. // if the states are changed.
var STORAGE_PREFIX = 'audioplayer-'; const STORAGE_PREFIX = 'audioplayer-';
var KEYS_TO_SAVE_STATES = const KEYS_TO_SAVE_STATES = [
['shuffle', 'shuffle', 'repeat-mode', 'volume', 'playlist-expanded',
'repeat-mode', 'track-info-expanded'
'volume', ];
'playlist-expanded', const storageKeys = KEYS_TO_SAVE_STATES.map(a => STORAGE_PREFIX + a);
'track-info-expanded'];
var storageKeys = KEYS_TO_SAVE_STATES.map(a => STORAGE_PREFIX + a);
chrome.storage.local.get(storageKeys, function(results) { chrome.storage.local.get(storageKeys, function(results) {
// Update the UI by loaded state. // Update the UI by loaded state.
for (var storageKey in results) { for (const storageKey in results) {
var key = storageKey.substr(STORAGE_PREFIX.length); const key = storageKey.substr(STORAGE_PREFIX.length);
this.player_[Polymer.CaseMap.dashToCamelCase(key)] = results[storageKey]; this.player_[Polymer.CaseMap.dashToCamelCase(key)] = results[storageKey];
} }
// Start listening to UI changes to write back the states to local storage. // Start listening to UI changes to write back the states to local storage.
for (var i = 0; i < KEYS_TO_SAVE_STATES.length; i++) { for (let i = 0; i < KEYS_TO_SAVE_STATES.length; i++) {
this.player_.addEventListener( this.player_.addEventListener(
KEYS_TO_SAVE_STATES[i] + '-changed', KEYS_TO_SAVE_STATES[i] + '-changed', function(storageKey, event) {
function(storageKey, event) { const objectToBeSaved = {};
var objectToBeSaved = {};
objectToBeSaved[storageKey] = event.detail.value; objectToBeSaved[storageKey] = event.detail.value;
chrome.storage.local.set(objectToBeSaved); chrome.storage.local.set(objectToBeSaved);
}.bind(this, storageKeys[i])); }.bind(this, storageKeys[i]));
...@@ -134,7 +131,7 @@ function AudioPlayer(container) { ...@@ -134,7 +131,7 @@ function AudioPlayer(container) {
document.addEventListener('keydown', this.onKeyDown_.bind(this)); document.addEventListener('keydown', this.onKeyDown_.bind(this));
// Show the window after DOM is processed. // Show the window after DOM is processed.
var currentWindow = chrome.app.window.current(); const currentWindow = chrome.app.window.current();
if (currentWindow) { if (currentWindow) {
setTimeout(currentWindow.show.bind(currentWindow), 0); setTimeout(currentWindow.show.bind(currentWindow), 0);
} }
...@@ -193,19 +190,18 @@ AudioPlayer.prototype.load = function(playlist) { ...@@ -193,19 +190,18 @@ AudioPlayer.prototype.load = function(playlist) {
util.URLsToEntries(playlist.items || [], function(entries) { util.URLsToEntries(playlist.items || [], function(entries) {
this.entries_ = entries; this.entries_ = entries;
var position = playlist.position || 0; const position = playlist.position || 0;
var time = playlist.time || 0;
if (this.entries_.length == 0) { if (this.entries_.length == 0) {
return; return;
} }
var newTracks = []; const newTracks = [];
var currentTracks = this.player_.tracks; const currentTracks = this.player_.tracks;
var unchanged = (currentTracks.length === this.entries_.length); let unchanged = (currentTracks.length === this.entries_.length);
for (var i = 0; i != this.entries_.length; i++) { for (let i = 0; i != this.entries_.length; i++) {
var entry = this.entries_[i]; const entry = this.entries_[i];
newTracks.push(new AudioPlayer.TrackInfo(entry)); newTracks.push(new AudioPlayer.TrackInfo(entry));
if (unchanged && entry.toURL() !== currentTracks[i].url) { if (unchanged && entry.toURL() !== currentTracks[i].url) {
...@@ -224,7 +220,7 @@ AudioPlayer.prototype.load = function(playlist) { ...@@ -224,7 +220,7 @@ AudioPlayer.prototype.load = function(playlist) {
// Load the selected track metadata first, then load the rest. // Load the selected track metadata first, then load the rest.
this.loadMetadata_(position); this.loadMetadata_(position);
for (i = 0; i != this.entries_.length; i++) { for (let i = 0; i != this.entries_.length; i++) {
if (i != position) { if (i != position) {
this.loadMetadata_(i); this.loadMetadata_(i);
} }
...@@ -311,7 +307,7 @@ AudioPlayer.prototype.select_ = function(newTrack) { ...@@ -311,7 +307,7 @@ AudioPlayer.prototype.select_ = function(newTrack) {
window.appState.time = 0; window.appState.time = 0;
appUtil.saveAppState(); appUtil.saveAppState();
var entry = this.entries_[this.currentTrackIndex_]; const entry = this.entries_[this.currentTrackIndex_];
this.fetchMetadata_(entry, function(metadata) { this.fetchMetadata_(entry, function(metadata) {
if (this.currentTrackIndex_ != newTrack) { if (this.currentTrackIndex_ != newTrack) {
...@@ -345,18 +341,17 @@ AudioPlayer.prototype.fetchMetadata_ = function(entry, callback) { ...@@ -345,18 +341,17 @@ AudioPlayer.prototype.fetchMetadata_ = function(entry, callback) {
* @private * @private
*/ */
AudioPlayer.prototype.onError_ = function() { AudioPlayer.prototype.onError_ = function() {
var track = this.currentTrackIndex_; const track = this.currentTrackIndex_;
this.invalidTracks_[track] = true; this.invalidTracks_[track] = true;
this.fetchMetadata_( this.fetchMetadata_(this.entries_[track], function(metadata) {
this.entries_[track], const error = (!navigator.onLine && !metadata.present) ?
function(metadata) { this.offlineString_ :
var error = (!navigator.onLine && !metadata.present) ? this.errorString_;
this.offlineString_ : this.errorString_; this.displayMetadata_(track, metadata, error);
this.displayMetadata_(track, metadata, error); this.player_.onAudioError();
this.player_.onAudioError(); }.bind(this));
}.bind(this));
}; };
/** /**
...@@ -366,8 +361,8 @@ AudioPlayer.prototype.onError_ = function() { ...@@ -366,8 +361,8 @@ AudioPlayer.prototype.onError_ = function() {
* @private * @private
*/ */
AudioPlayer.prototype.onResize_ = function(event) { AudioPlayer.prototype.onResize_ = function(event) {
var trackListHeight = const trackListHeight =
(/** @type {{trackList:TrackListElement}} */ (this.player_.$)) (/** @type {{trackList:TrackListElement}} */ (this.player_.$))
.trackList.clientHeight; .trackList.clientHeight;
if (trackListHeight > AudioPlayer.TOP_PADDING_HEIGHT) { if (trackListHeight > AudioPlayer.TOP_PADDING_HEIGHT) {
this.isPlaylistExpanded_ = true; this.isPlaylistExpanded_ = true;
...@@ -393,16 +388,20 @@ AudioPlayer.prototype.onKeyDown_ = function(event) { ...@@ -393,16 +388,20 @@ AudioPlayer.prototype.onKeyDown_ = function(event) {
// Handle debug shortcut keys. // Handle debug shortcut keys.
case 'Ctrl-Shift-I': // Ctrl+Shift+I case 'Ctrl-Shift-I': // Ctrl+Shift+I
chrome.fileManagerPrivate.openInspector('normal'); chrome.fileManagerPrivate.openInspector(
chrome.fileManagerPrivate.InspectionType.NORMAL);
break; break;
case 'Ctrl-Shift-J': // Ctrl+Shift+J case 'Ctrl-Shift-J': // Ctrl+Shift+J
chrome.fileManagerPrivate.openInspector('console'); chrome.fileManagerPrivate.openInspector(
chrome.fileManagerPrivate.InspectionType.CONSOLE);
break; break;
case 'Ctrl-Shift-C': // Ctrl+Shift+C case 'Ctrl-Shift-C': // Ctrl+Shift+C
chrome.fileManagerPrivate.openInspector('element'); chrome.fileManagerPrivate.openInspector(
chrome.fileManagerPrivate.InspectionType.ELEMENT);
break; break;
case 'Ctrl-Shift-B': // Ctrl+Shift+B case 'Ctrl-Shift-B': // Ctrl+Shift+B
chrome.fileManagerPrivate.openInspector('background'); chrome.fileManagerPrivate.openInspector(
chrome.fileManagerPrivate.InspectionType.BACKGROUND);
break; break;
case ' ': // Space case ' ': // Space
...@@ -416,16 +415,16 @@ AudioPlayer.prototype.onKeyDown_ = function(event) { ...@@ -416,16 +415,16 @@ AudioPlayer.prototype.onKeyDown_ = function(event) {
case 'ArrowDown': case 'ArrowDown':
this.player_.dispatchEvent(new Event('small-backword-skip-event')); this.player_.dispatchEvent(new Event('small-backword-skip-event'));
break; break;
case 'ArrowRight': case 'ArrowRight': {
var eventName = this.isRtl_ ? 'small-backword-skip-event' : const eventName = this.isRtl_ ? 'small-backword-skip-event' :
'small-forward-skip-event'; 'small-forward-skip-event';
this.player_.dispatchEvent(new Event(eventName)); this.player_.dispatchEvent(new Event(eventName));
break; } break;
case 'ArrowLeft': case 'ArrowLeft': {
var eventName = this.isRtl_ ? 'small-forward-skip-event' : const eventName = this.isRtl_ ? 'small-forward-skip-event' :
'small-backword-skip-event'; 'small-backword-skip-event';
this.player_.dispatchEvent(new Event(eventName)); this.player_.dispatchEvent(new Event(eventName));
break; } break;
case 'l': case 'l':
this.player_.dispatchEvent(new Event('big-forward-skip-event')); this.player_.dispatchEvent(new Event('big-forward-skip-event'));
break; break;
...@@ -571,8 +570,8 @@ AudioPlayer.prototype.onTrackInfoExpandedChanged_ = function(newValue) { ...@@ -571,8 +570,8 @@ AudioPlayer.prototype.onTrackInfoExpandedChanged_ = function(newValue) {
if (this.isTrackInfoExpanded_ !== newValue) { if (this.isTrackInfoExpanded_ !== newValue) {
this.isTrackInfoExpanded_ = newValue; this.isTrackInfoExpanded_ = newValue;
var state = chrome.app.window.current(); const state = chrome.app.window.current();
var newHeight = window.outerHeight; let newHeight = window.outerHeight;
if (newValue) { if (newValue) {
state.innerBounds.minHeight = AudioPlayer.EXPANDED_MODE_MIN_HEIGHT; state.innerBounds.minHeight = AudioPlayer.EXPANDED_MODE_MIN_HEIGHT;
newHeight += AudioPlayer.EXPANDED_MODE_MIN_HEIGHT - newHeight += AudioPlayer.EXPANDED_MODE_MIN_HEIGHT -
...@@ -594,15 +593,15 @@ AudioPlayer.prototype.onTrackInfoExpandedChanged_ = function(newValue) { ...@@ -594,15 +593,15 @@ AudioPlayer.prototype.onTrackInfoExpandedChanged_ = function(newValue) {
* @private * @private
*/ */
AudioPlayer.prototype.syncHeightForPlaylist_ = function() { AudioPlayer.prototype.syncHeightForPlaylist_ = function() {
var targetInnerHeight; let targetInnerHeight;
if (this.player_.playlistExpanded) { if (this.player_.playlistExpanded) {
// playllist expanded. // playllist expanded.
if (!this.lastExpandedInnerHeight_ || if (!this.lastExpandedInnerHeight_ ||
this.lastExpandedInnerHeight_ < AudioPlayer.EXPANDED_MODE_MIN_HEIGHT) { this.lastExpandedInnerHeight_ < AudioPlayer.EXPANDED_MODE_MIN_HEIGHT) {
var expandedListHeight = const expandedListHeight =
Math.min(this.entries_.length, AudioPlayer.DEFAULT_EXPANDED_ITEMS) * Math.min(this.entries_.length, AudioPlayer.DEFAULT_EXPANDED_ITEMS) *
AudioPlayer.TRACK_HEIGHT; AudioPlayer.TRACK_HEIGHT;
if (this.player_.trackInfoExpanded) { if (this.player_.trackInfoExpanded) {
targetInnerHeight = AudioPlayer.TOP_PADDING_HEIGHT + targetInnerHeight = AudioPlayer.TOP_PADDING_HEIGHT +
AudioPlayer.EXPANDED_ARTWORK_HEIGHT + AudioPlayer.EXPANDED_ARTWORK_HEIGHT +
...@@ -653,9 +652,11 @@ AudioPlayer.TrackInfo = function(entry) { ...@@ -653,9 +652,11 @@ AudioPlayer.TrackInfo = function(entry) {
* @return {string} Default track title (file name extracted from the url). * @return {string} Default track title (file name extracted from the url).
*/ */
AudioPlayer.TrackInfo.prototype.getDefaultTitle = function() { AudioPlayer.TrackInfo.prototype.getDefaultTitle = function() {
var title = this.url.split('/').pop(); let title = this.url.split('/').pop();
var dotIndex = title.lastIndexOf('.'); const dotIndex = title.lastIndexOf('.');
if (dotIndex >= 0) title = title.substr(0, dotIndex); if (dotIndex >= 0) {
title = title.substr(0, dotIndex);
}
title = decodeURIComponent(title); title = decodeURIComponent(title);
return title; return title;
}; };
......
...@@ -107,7 +107,7 @@ class CrostiniImpl { ...@@ -107,7 +107,7 @@ class CrostiniImpl {
// Record UMA. // Record UMA.
const root = this.getRoot_(entry); const root = this.getRoot_(entry);
let suffix = CrostiniImpl.VALID_ROOT_TYPES_FOR_SHARE.get(root) || const suffix = CrostiniImpl.VALID_ROOT_TYPES_FOR_SHARE.get(root) ||
CrostiniImpl.UMA_ROOT_TYPE_OTHER; CrostiniImpl.UMA_ROOT_TYPE_OTHER;
metrics.recordSmallCount( metrics.recordSmallCount(
'CrostiniSharedPaths.Depth.' + suffix, 'CrostiniSharedPaths.Depth.' + suffix,
...@@ -143,7 +143,7 @@ class CrostiniImpl { ...@@ -143,7 +143,7 @@ class CrostiniImpl {
/** /**
* Handles events for enable/disable, share/unshare. * Handles events for enable/disable, share/unshare.
* @param {chrome.fileManagerPrivate.CrostiniEvent} event * @param {!chrome.fileManagerPrivate.CrostiniEvent} event
* @private * @private
*/ */
onCrostiniChanged_(event) { onCrostiniChanged_(event) {
...@@ -156,12 +156,12 @@ class CrostiniImpl { ...@@ -156,12 +156,12 @@ class CrostiniImpl {
break; break;
case chrome.fileManagerPrivate.CrostiniEventType.SHARE: case chrome.fileManagerPrivate.CrostiniEventType.SHARE:
for (const entry of event.entries) { for (const entry of event.entries) {
this.registerSharedPath(event.vmName, entry); this.registerSharedPath(event.vmName, assert(entry));
} }
break; break;
case chrome.fileManagerPrivate.CrostiniEventType.UNSHARE: case chrome.fileManagerPrivate.CrostiniEventType.UNSHARE:
for (const entry of event.entries) { for (const entry of event.entries) {
this.unregisterSharedPath(event.vmName, entry); this.unregisterSharedPath(event.vmName, assert(entry));
} }
break; break;
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
// Namespace // Namespace
var importer = importer || {}; window.importer = window.importer || {};
/** /**
* A duplicate finder for Google Drive. * A duplicate finder for Google Drive.
...@@ -138,7 +138,6 @@ importer.DriveDuplicateFinder = class DriveDuplicateFinder { ...@@ -138,7 +138,6 @@ importer.DriveDuplicateFinder = class DriveDuplicateFinder {
volumeId, [hash], volumeId, [hash],
/** /**
* @param {!Object<string, !Array<string>>|undefined} urls * @param {!Object<string, !Array<string>>|undefined} urls
* @this {importer.DriveDuplicateFinder}
*/ */
urls => { urls => {
const elapsedTime = new Date().getTime() - startTime; const elapsedTime = new Date().getTime() - startTime;
......
...@@ -247,8 +247,8 @@ Object.freeze(DriveMetadataSearchContentScanner.SearchType); ...@@ -247,8 +247,8 @@ Object.freeze(DriveMetadataSearchContentScanner.SearchType);
class RecentContentScanner extends ContentScanner { class RecentContentScanner extends ContentScanner {
/** /**
* @param {string} query Search query. * @param {string} query Search query.
* @param {string=} opt_sourceRestriction * @param {chrome.fileManagerPrivate.SourceRestriction=} opt_sourceRestriction
* @param {string=} opt_recentFileType * @param {chrome.fileManagerPrivate.RecentFileType=} opt_recentFileType
*/ */
constructor(query, opt_sourceRestriction, opt_recentFileType) { constructor(query, opt_sourceRestriction, opt_recentFileType) {
super(); super();
...@@ -259,13 +259,13 @@ class RecentContentScanner extends ContentScanner { ...@@ -259,13 +259,13 @@ class RecentContentScanner extends ContentScanner {
this.query_ = query.toLowerCase(); this.query_ = query.toLowerCase();
/** /**
* @private {string} * @private {chrome.fileManagerPrivate.SourceRestriction}
*/ */
this.sourceRestriction_ = opt_sourceRestriction || this.sourceRestriction_ = opt_sourceRestriction ||
chrome.fileManagerPrivate.SourceRestriction.ANY_SOURCE; chrome.fileManagerPrivate.SourceRestriction.ANY_SOURCE;
/** /**
* @private {string} * @private {chrome.fileManagerPrivate.RecentFileType}
*/ */
this.recentFileType_ = this.recentFileType_ =
opt_recentFileType || chrome.fileManagerPrivate.RecentFileType.ALL; opt_recentFileType || chrome.fileManagerPrivate.RecentFileType.ALL;
......
...@@ -1187,7 +1187,7 @@ class FileManager extends cr.EventTarget { ...@@ -1187,7 +1187,7 @@ class FileManager extends cr.EventTarget {
(entries, firstForSession) => { (entries, firstForSession) => {
showToast = showToast || firstForSession; showToast = showToast || firstForSession;
for (const entry of entries) { for (const entry of entries) {
this.crostini_.registerSharedPath(vmName, entry); this.crostini_.registerSharedPath(vmName, assert(entry));
} }
resolve(entries.length); resolve(entries.length);
}); });
......
...@@ -2263,7 +2263,8 @@ CommandHandler.COMMANDS_['unpin-folder'] = new class extends Command { ...@@ -2263,7 +2263,8 @@ CommandHandler.COMMANDS_['unpin-folder'] = new class extends Command {
*/ */
CommandHandler.COMMANDS_['zoom-in'] = new class extends Command { CommandHandler.COMMANDS_['zoom-in'] = new class extends Command {
execute(event, fileManager) { execute(event, fileManager) {
chrome.fileManagerPrivate.zoom('in'); chrome.fileManagerPrivate.zoom(
chrome.fileManagerPrivate.ZoomOperationType.IN);
} }
}; };
...@@ -2272,7 +2273,8 @@ CommandHandler.COMMANDS_['zoom-in'] = new class extends Command { ...@@ -2272,7 +2273,8 @@ CommandHandler.COMMANDS_['zoom-in'] = new class extends Command {
*/ */
CommandHandler.COMMANDS_['zoom-out'] = new class extends Command { CommandHandler.COMMANDS_['zoom-out'] = new class extends Command {
execute(event, fileManager) { execute(event, fileManager) {
chrome.fileManagerPrivate.zoom('out'); chrome.fileManagerPrivate.zoom(
chrome.fileManagerPrivate.ZoomOperationType.OUT);
} }
}; };
...@@ -2281,7 +2283,8 @@ CommandHandler.COMMANDS_['zoom-out'] = new class extends Command { ...@@ -2281,7 +2283,8 @@ CommandHandler.COMMANDS_['zoom-out'] = new class extends Command {
*/ */
CommandHandler.COMMANDS_['zoom-reset'] = new class extends Command { CommandHandler.COMMANDS_['zoom-reset'] = new class extends Command {
execute(event, fileManager) { execute(event, fileManager) {
chrome.fileManagerPrivate.zoom('reset'); chrome.fileManagerPrivate.zoom(
chrome.fileManagerPrivate.ZoomOperationType.RESET);
} }
}; };
...@@ -2342,7 +2345,8 @@ CommandHandler.COMMANDS_['sort-by-date'] = new class extends Command { ...@@ -2342,7 +2345,8 @@ CommandHandler.COMMANDS_['sort-by-date'] = new class extends Command {
*/ */
CommandHandler.COMMANDS_['inspect-normal'] = new class extends Command { CommandHandler.COMMANDS_['inspect-normal'] = new class extends Command {
execute(event, fileManager) { execute(event, fileManager) {
chrome.fileManagerPrivate.openInspector('normal'); chrome.fileManagerPrivate.openInspector(
chrome.fileManagerPrivate.InspectionType.NORMAL);
} }
}; };
...@@ -2351,7 +2355,8 @@ CommandHandler.COMMANDS_['inspect-normal'] = new class extends Command { ...@@ -2351,7 +2355,8 @@ CommandHandler.COMMANDS_['inspect-normal'] = new class extends Command {
*/ */
CommandHandler.COMMANDS_['inspect-console'] = new class extends Command { CommandHandler.COMMANDS_['inspect-console'] = new class extends Command {
execute(event, fileManager) { execute(event, fileManager) {
chrome.fileManagerPrivate.openInspector('console'); chrome.fileManagerPrivate.openInspector(
chrome.fileManagerPrivate.InspectionType.CONSOLE);
} }
}; };
...@@ -2360,7 +2365,8 @@ CommandHandler.COMMANDS_['inspect-console'] = new class extends Command { ...@@ -2360,7 +2365,8 @@ CommandHandler.COMMANDS_['inspect-console'] = new class extends Command {
*/ */
CommandHandler.COMMANDS_['inspect-element'] = new class extends Command { CommandHandler.COMMANDS_['inspect-element'] = new class extends Command {
execute(event, fileManager) { execute(event, fileManager) {
chrome.fileManagerPrivate.openInspector('element'); chrome.fileManagerPrivate.openInspector(
chrome.fileManagerPrivate.InspectionType.ELEMENT);
} }
}; };
...@@ -2369,7 +2375,8 @@ CommandHandler.COMMANDS_['inspect-element'] = new class extends Command { ...@@ -2369,7 +2375,8 @@ CommandHandler.COMMANDS_['inspect-element'] = new class extends Command {
*/ */
CommandHandler.COMMANDS_['inspect-background'] = new class extends Command { CommandHandler.COMMANDS_['inspect-background'] = new class extends Command {
execute(event, fileManager) { execute(event, fileManager) {
chrome.fileManagerPrivate.openInspector('background'); chrome.fileManagerPrivate.openInspector(
chrome.fileManagerPrivate.InspectionType.BACKGROUND);
} }
}; };
......
...@@ -274,6 +274,18 @@ class TaskController { ...@@ -274,6 +274,18 @@ class TaskController {
this.ui_.fileContextMenu.defaultTaskMenuItem.taskId), this.ui_.fileContextMenu.defaultTaskMenuItem.taskId),
title: /** @type {string} */ ( title: /** @type {string} */ (
this.ui_.fileContextMenu.defaultTaskMenuItem.label), this.ui_.fileContextMenu.defaultTaskMenuItem.label),
get iconUrl() {
assert(false);
return '';
},
get isDefault() {
assert(false);
return false;
},
get isGenericFileHandler() {
assert(false);
return false;
},
}; };
tasks.execute(task); tasks.execute(task);
}) })
......
...@@ -27,7 +27,7 @@ crostiniTasks.testErrorLoadingLinuxPackageInfo = async (done) => { ...@@ -27,7 +27,7 @@ crostiniTasks.testErrorLoadingLinuxPackageInfo = async (done) => {
const oldGetLinuxPackageInfo = chrome.fileManagerPrivate.getLinuxPackageInfo; const oldGetLinuxPackageInfo = chrome.fileManagerPrivate.getLinuxPackageInfo;
let packageInfoCallback = null; let packageInfoCallback = null;
chrome.fileManagerPrivate.getLinuxPackageInfo = (entry, callback) => { chrome.fileManagerPrivate.getLinuxPackageInfo = (entry, callback) => {
packageInfoCallback = callback; packageInfoCallback = /** @type{function():void} */ (callback);
}; };
await test.setupAndWaitUntilReady([], [], [test.ENTRIES.debPackage]); await test.setupAndWaitUntilReady([], [], [test.ENTRIES.debPackage]);
...@@ -53,7 +53,7 @@ crostiniTasks.testErrorLoadingLinuxPackageInfo = async (done) => { ...@@ -53,7 +53,7 @@ crostiniTasks.testErrorLoadingLinuxPackageInfo = async (done) => {
// Call the callback with an error. // Call the callback with an error.
chrome.runtime.lastError = {message: 'error message'}; chrome.runtime.lastError = {message: 'error message'};
packageInfoCallback(undefined); packageInfoCallback();
delete chrome.runtime.lastError; delete chrome.runtime.lastError;
assertEquals( assertEquals(
'Details\nFailed to retrieve app info.', 'Details\nFailed to retrieve app info.',
......
This diff is collapsed.
...@@ -285,7 +285,8 @@ ImageRequest.prototype.downloadOriginal_ = function(onSuccess, onFailure) { ...@@ -285,7 +285,8 @@ ImageRequest.prototype.downloadOriginal_ = function(onSuccess, onFailure) {
drivefsUrlMatches[1], drivefsUrlMatches[1],
entry => { entry => {
chrome.fileManagerPrivate.getThumbnail( chrome.fileManagerPrivate.getThumbnail(
entry, !!this.request_.crop, thumbnail => { /** @type {FileEntry} */ (entry), !!this.request_.crop,
thumbnail => {
if (!thumbnail) { if (!thumbnail) {
onFailure(); onFailure();
return; return;
......
...@@ -108,16 +108,20 @@ class NativeControlsVideoPlayer { ...@@ -108,16 +108,20 @@ class NativeControlsVideoPlayer {
switch (key) { switch (key) {
// Handle debug shortcut keys. // Handle debug shortcut keys.
case 'Ctrl+Shift+I': case 'Ctrl+Shift+I':
chrome.fileManagerPrivate.openInspector('normal'); chrome.fileManagerPrivate.openInspector(
chrome.fileManagerPrivate.InspectionType.NORMAL);
break; break;
case 'Ctrl+Shift+J': case 'Ctrl+Shift+J':
chrome.fileManagerPrivate.openInspector('console'); chrome.fileManagerPrivate.openInspector(
chrome.fileManagerPrivate.InspectionType.CONSOLE);
break; break;
case 'Ctrl+Shift+C': case 'Ctrl+Shift+C':
chrome.fileManagerPrivate.openInspector('element'); chrome.fileManagerPrivate.openInspector(
chrome.fileManagerPrivate.InspectionType.ELEMENT);
break; break;
case 'Ctrl+Shift+B': case 'Ctrl+Shift+B':
chrome.fileManagerPrivate.openInspector('background'); chrome.fileManagerPrivate.openInspector(
chrome.fileManagerPrivate.InspectionType.BACKGROUND);
break; break;
case 'k': case 'k':
...@@ -262,7 +266,7 @@ class NativeControlsVideoPlayer { ...@@ -262,7 +266,7 @@ class NativeControlsVideoPlayer {
oldTop = window.screen.availHeight / 2; oldTop = window.screen.availHeight / 2;
} }
let appWindow = chrome.app.window.current(); const appWindow = chrome.app.window.current();
appWindow.innerBounds.width = Math.round(newWidth); appWindow.innerBounds.width = Math.round(newWidth);
appWindow.innerBounds.height = Math.round(newHeight); appWindow.innerBounds.height = Math.round(newHeight);
appWindow.outerBounds.left = appWindow.outerBounds.left =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment