Commit 7f03f103 authored by kinaba@chromium.org's avatar kinaba@chromium.org

Nitpicking fixes for Files.app code.

BUG=none

Review URL: https://codereview.chromium.org/274473004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269555 0039d316-1c4b-4281-b951-d872f2087c98
parent 4a1cab64
...@@ -236,6 +236,7 @@ std::string GetMountPointNameForMediaStorage( ...@@ -236,6 +236,7 @@ std::string GetMountPointNameForMediaStorage(
VolumeInfo::VolumeInfo() VolumeInfo::VolumeInfo()
: file_system_id(0), : file_system_id(0),
type(VOLUME_TYPE_GOOGLE_DRIVE), type(VOLUME_TYPE_GOOGLE_DRIVE),
device_type(chromeos::DEVICE_TYPE_UNKNOWN),
mount_condition(chromeos::disks::MOUNT_CONDITION_NONE), mount_condition(chromeos::disks::MOUNT_CONDITION_NONE),
is_parent(false), is_parent(false),
is_read_only(false) {} is_read_only(false) {}
......
...@@ -146,7 +146,7 @@ class VolumeManager : public KeyedService, ...@@ -146,7 +146,7 @@ class VolumeManager : public KeyedService,
bool FindVolumeInfoById(const std::string& volume_id, bool FindVolumeInfoById(const std::string& volume_id,
VolumeInfo* result) const; VolumeInfo* result) const;
// For testing purpose, registers a native local file system poniting to // For testing purpose, registers a native local file system pointing to
// |path| with DOWNLOADS type, and adds its volume info. // |path| with DOWNLOADS type, and adds its volume info.
bool RegisterDownloadsDirectoryForTesting(const base::FilePath& path); bool RegisterDownloadsDirectoryForTesting(const base::FilePath& path);
......
...@@ -200,7 +200,7 @@ Polymer('audio-player', { ...@@ -200,7 +200,7 @@ Polymer('audio-player', {
* list element. * list element.
*/ */
onReplayCurrentTrack: function() { onReplayCurrentTrack: function() {
// Changes the current time back to the beggining, regardless of the current // Changes the current time back to the beginning, regardless of the current
// status (playing or paused). // status (playing or paused).
this.audioElement.currentTime = 0; this.audioElement.currentTime = 0;
this.audioController.time = 0; this.audioController.time = 0;
...@@ -318,7 +318,7 @@ Polymer('audio-player', { ...@@ -318,7 +318,7 @@ Polymer('audio-player', {
}, },
/** /**
* Invoked the 'keydown' event is fired. * Invoked when the 'keydown' event is fired.
* @param {Event} event The event object. * @param {Event} event The event object.
*/ */
onKeyDown_: function(event) { onKeyDown_: function(event) {
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
/** /**
* Invoked when the model changed. * Invoked when the model changed.
* @param {AudioPlayerModel} oldValue Old Value. * @param {AudioPlayerModel} oldValue Old Value.
* @param {AudioPlayerModel} newValue Nld Value. * @param {AudioPlayerModel} newValue New Value.
*/ */
modelChanged: function(oldValue, newValue) { modelChanged: function(oldValue, newValue) {
this.onVolumeChanged((oldValue || {}).volume, (newValue || {}).volume); this.onVolumeChanged((oldValue || {}).volume, (newValue || {}).volume);
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
width: 32, width: 32,
/** /**
* Invoked the 'volume' value in the model is changed. * Invoked when the 'volume' value in the model is changed.
* @param {number} oldValue Old value. * @param {number} oldValue Old value.
* @param {number} newValue New value. * @param {number} newValue New value.
*/ */
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
}, },
/** /**
* Invoked the 'rawValue' property is changed. * Invoked when the 'rawValue' property is changed.
* @param {number} oldValue Old value. * @param {number} oldValue Old value.
* @param {number} newValue New value. * @param {number} newValue New value.
*/ */
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
}, },
/** /**
* Invoked the 'keydown' event is fired. * Invoked when the 'keydown' event is fired.
* @param {Event} event The event object. * @param {Event} event The event object.
*/ */
onKeyDown_: function(event) { onKeyDown_: function(event) {
......
...@@ -434,8 +434,8 @@ FileOperationManager.Task = function( ...@@ -434,8 +434,8 @@ FileOperationManager.Task = function(
// If directory already exists, we try to make a copy named 'dir (X)', // If directory already exists, we try to make a copy named 'dir (X)',
// where X is a number. When we do this, all subsequent copies from // where X is a number. When we do this, all subsequent copies from
// inside the subtree should be mapped to the new directory name. // inside the subtree should be mapped to the new directory name.
// For example, if 'dir' was copied as 'dir (1)', then 'dir\file.txt' should // For example, if 'dir' was copied as 'dir (1)', then 'dir/file.txt' should
// become 'dir (1)\file.txt'. // become 'dir (1)/file.txt'.
this.renamedDirectories_ = []; this.renamedDirectories_ = [];
}; };
......
...@@ -346,7 +346,7 @@ FileListBannerController.prototype.checkSpaceAndMaybeShowWelcomeBanner_ = ...@@ -346,7 +346,7 @@ FileListBannerController.prototype.checkSpaceAndMaybeShowWelcomeBanner_ =
// minimize the invocation. // minimize the invocation.
group.add(function(onCompleted) { group.add(function(onCompleted) {
// Current directory must be set, since this code is called after // Current directory must be set, since this code is called after
// scaning is completed. However, the volumeInfo may be gone. // scanning is completed. However, the volumeInfo may be gone.
chrome.fileBrowserPrivate.getSizeStats( chrome.fileBrowserPrivate.getSizeStats(
driveVolume.volumeId, driveVolume.volumeId,
function(result) { function(result) {
......
...@@ -788,7 +788,7 @@ ImageEditor.MouseControl.prototype.setDoubleTapCallback = function(callback) { ...@@ -788,7 +788,7 @@ ImageEditor.MouseControl.prototype.setDoubleTapCallback = function(callback) {
}; };
/** /**
* Touch chancel handler. * Touch cancel handler.
*/ */
ImageEditor.MouseControl.prototype.onTouchCancel = function() { ImageEditor.MouseControl.prototype.onTouchCancel = function() {
this.dragHandler_ = null; this.dragHandler_ = null;
...@@ -1119,7 +1119,7 @@ ImageEditor.Prompt.prototype.setTimer = function(callback, timeout) { ...@@ -1119,7 +1119,7 @@ ImageEditor.Prompt.prototype.setTimer = function(callback, timeout) {
* *
* @param {string} text The prompt text. * @param {string} text The prompt text.
* @param {number} timeout Timeout in ms. * @param {number} timeout Timeout in ms.
* @param {Object} formatArgs varArgs for the formatting fuction. * @param {Object} formatArgs varArgs for the formatting function.
*/ */
ImageEditor.Prompt.prototype.show = function(text, timeout, formatArgs) { ImageEditor.Prompt.prototype.show = function(text, timeout, formatArgs) {
this.showAt.apply(this, this.showAt.apply(this,
......
...@@ -468,7 +468,7 @@ AudioPlayer.prototype.syncHeight_ = function() { ...@@ -468,7 +468,7 @@ AudioPlayer.prototype.syncHeight_ = function() {
targetHeight = AudioPlayer.CONTROLS_HEIGHT + expandedListHeight; targetHeight = AudioPlayer.CONTROLS_HEIGHT + expandedListHeight;
} }
} else { } else {
// Not expaned. // Not expanded.
targetHeight = AudioPlayer.CONTROLS_HEIGHT + AudioPlayer.TRACK_HEIGHT; targetHeight = AudioPlayer.CONTROLS_HEIGHT + AudioPlayer.TRACK_HEIGHT;
} }
......
...@@ -99,7 +99,7 @@ BreadcrumbsController.prototype.show = function(entry) { ...@@ -99,7 +99,7 @@ BreadcrumbsController.prototype.show = function(entry) {
queue.run(resolveParent.bind(this, entry, null)); queue.run(resolveParent.bind(this, entry, null));
queue.run(function(callback) { queue.run(function(callback) {
// If an error was occured, just skip. // If an error occurred, just skip.
if (error) { if (error) {
callback(); callback();
return; return;
......
...@@ -91,7 +91,7 @@ ConflictDialog.prototype = { ...@@ -91,7 +91,7 @@ ConflictDialog.prototype = {
* *
* @param {string} fileName Filename that is conflicted. * @param {string} fileName Filename that is conflicted.
* @param {function(ConflictDialog.Result, boolean)} callback Complete * @param {function(ConflictDialog.Result, boolean)} callback Complete
* callbak. See also ConflictDialog#callback_. * callback. See also ConflictDialog#callback_.
* @return {boolean} True if the dialog can show successfully. False if the * @return {boolean} True if the dialog can show successfully. False if the
* dialog failed to show due to an existing dialog. * dialog failed to show due to an existing dialog.
*/ */
......
...@@ -310,7 +310,7 @@ NavigationList.prototype.activateModelItem_ = function(modelItem) { ...@@ -310,7 +310,7 @@ NavigationList.prototype.activateModelItem_ = function(modelItem) {
url, url,
onEntryResolved, onEntryResolved,
function() { function() {
// Error, the entry can't be re-resolved. It may happen for shotrcuts // Error, the entry can't be re-resolved. It may happen for shortcuts
// which targets got removed after resolving the Entry during // which targets got removed after resolving the Entry during
// initialization. // initialization.
this.dataModel.onItemNotFoundError(modelItem); this.dataModel.onItemNotFoundError(modelItem);
......
...@@ -159,7 +159,7 @@ PreviewPanel.prototype = { ...@@ -159,7 +159,7 @@ PreviewPanel.prototype = {
set visibilityType(visibilityType) { set visibilityType(visibilityType) {
this.visibilityType_ = visibilityType; this.visibilityType_ = visibilityType;
this.updateVisibility_(); this.updateVisibility_();
// Also update the preview area contents, because the update is surpressed // Also update the preview area contents, because the update is suppressed
// while the visibility is hiding or hidden. // while the visibility is hiding or hidden.
this.updatePreviewArea_(); this.updatePreviewArea_();
}, },
...@@ -186,7 +186,7 @@ PreviewPanel.prototype.initialize = function() { ...@@ -186,7 +186,7 @@ PreviewPanel.prototype.initialize = function() {
this.element_.addEventListener('webkitTransitionEnd', this.element_.addEventListener('webkitTransitionEnd',
this.onTransitionEnd_.bind(this)); this.onTransitionEnd_.bind(this));
this.updateVisibility_(); this.updateVisibility_();
// Also update the preview area contents, because the update is surpressed // Also update the preview area contents, because the update is suppressed
// while the visibility is hiding or hidden. // while the visibility is hiding or hidden.
this.updatePreviewArea_(); this.updatePreviewArea_();
}; };
...@@ -251,7 +251,7 @@ PreviewPanel.prototype.updateVisibility_ = function() { ...@@ -251,7 +251,7 @@ PreviewPanel.prototype.updateVisibility_ = function() {
* @private * @private
*/ */
PreviewPanel.prototype.updatePreviewArea_ = function(breadCrumbsVisible) { PreviewPanel.prototype.updatePreviewArea_ = function(breadCrumbsVisible) {
// If the previw panel is hiding, does not update the current view. // If the preview panel is hiding, does not update the current view.
if (!this.visible) if (!this.visible)
return; return;
var selection = this.selection_; var selection = this.selection_;
......
...@@ -49,7 +49,7 @@ function ProgressCenterItemElement(document) { ...@@ -49,7 +49,7 @@ function ProgressCenterItemElement(document) {
*/ */
ProgressCenterItemElement.safelySetAnimation_ = function(callback) { ProgressCenterItemElement.safelySetAnimation_ = function(callback) {
var requestId = requestAnimationFrame(function() { var requestId = requestAnimationFrame(function() {
// The transitoin start properties currently set are rendered at this frame. // The transition start properties currently set are rendered at this frame.
// And the transition end properties set by the callback is rendered at the // And the transition end properties set by the callback is rendered at the
// next frame. // next frame.
requestId = requestAnimationFrame(callback); requestId = requestAnimationFrame(callback);
...@@ -67,9 +67,9 @@ ProgressCenterItemElement.safelySetAnimation_ = function(callback) { ...@@ -67,9 +67,9 @@ ProgressCenterItemElement.safelySetAnimation_ = function(callback) {
ProgressCenterItemElement.PROGRESS_ANIMATION_END_EVENT = 'progressAnimationEnd'; ProgressCenterItemElement.PROGRESS_ANIMATION_END_EVENT = 'progressAnimationEnd';
/** /**
* Decoreates the given element as a progress item. * Decorates the given element as a progress item.
* @param {HTMLElement} element Item to be decoreated. * @param {HTMLElement} element Item to be decorated.
* @return {ProgressCenterItemElement} Decoreated item. * @return {ProgressCenterItemElement} Decorated item.
*/ */
ProgressCenterItemElement.decorate = function(element) { ProgressCenterItemElement.decorate = function(element) {
element.__proto__ = ProgressCenterItemElement.prototype; element.__proto__ = ProgressCenterItemElement.prototype;
......
...@@ -105,7 +105,7 @@ SearchBox.AutocompleteList.prototype.onMouseOver_ = function(event) { ...@@ -105,7 +105,7 @@ SearchBox.AutocompleteList.prototype.onMouseOver_ = function(event) {
}; };
/** /**
* ListItem element for autocomple. * ListItem element for autocomplete.
* *
* @param {HTMLDocument} document Document. * @param {HTMLDocument} document Document.
* @param {Object} item An object representing a suggestion. * @param {Object} item An object representing a suggestion.
...@@ -193,7 +193,7 @@ SearchBox.prototype.onIconClick_ = function() { ...@@ -193,7 +193,7 @@ SearchBox.prototype.onIconClick_ = function() {
SearchBox.prototype.onDragEnter_ = function(event) { SearchBox.prototype.onDragEnter_ = function(event) {
// For normal elements, they does not accept drag drop by default, and accept // For normal elements, they does not accept drag drop by default, and accept
// it by using event.preventDefault. But input elements accept drag drop // it by using event.preventDefault. But input elements accept drag drop
// by default. So disalbe the input element here to prohibit drag drop. // by default. So disable the input element here to prohibit drag drop.
if (event.dataTransfer.types.indexOf('text/plain') === -1) if (event.dataTransfer.types.indexOf('text/plain') === -1)
this.inputElement.style.pointerEvents = 'none'; this.inputElement.style.pointerEvents = 'none';
}; };
......
...@@ -67,14 +67,14 @@ function Gallery(volumeManager) { ...@@ -67,14 +67,14 @@ function Gallery(volumeManager) {
Gallery.prototype.__proto__ = cr.EventTarget.prototype; Gallery.prototype.__proto__ = cr.EventTarget.prototype;
/** /**
* Tools fade-out timeout im milliseconds. * Tools fade-out timeout in milliseconds.
* @const * @const
* @type {number} * @type {number}
*/ */
Gallery.FADE_TIMEOUT = 3000; Gallery.FADE_TIMEOUT = 3000;
/** /**
* First time tools fade-out timeout im milliseconds. * First time tools fade-out timeout in milliseconds.
* @const * @const
* @type {number} * @type {number}
*/ */
......
...@@ -466,7 +466,7 @@ Mosaic.prototype.onSplice_ = function(event) { ...@@ -466,7 +466,7 @@ Mosaic.prototype.onSplice_ = function(event) {
if (event.removed.length) { if (event.removed.length) {
for (var t = 0; t !== event.removed.length; t++) { for (var t = 0; t !== event.removed.length; t++) {
// If the layout for the tile has not done yet, the parent is null. // If the layout for the tile has not done yet, the parent is null.
// And the layout will not be done after onSplice_ becuase it is removed // And the layout will not be done after onSplice_ because it is removed
// from this.tiles_. // from this.tiles_.
if (this.tiles_[index + t].parentNode) if (this.tiles_[index + t].parentNode)
this.removeChild(this.tiles_[index + t]); this.removeChild(this.tiles_[index + t]);
......
...@@ -284,7 +284,7 @@ Cache.prototype.loadImage = function(key, timestamp, onSuccess, onFailure) { ...@@ -284,7 +284,7 @@ Cache.prototype.loadImage = function(key, timestamp, onSuccess, onFailure) {
// Check if both entries are available or both unavailable. // Check if both entries are available or both unavailable.
if (!!metadataEntry != !!dataEntry) { if (!!metadataEntry != !!dataEntry) {
console.warn('Incosistent cache database.'); console.warn('Inconsistent cache database.');
onFailure(); onFailure();
return; return;
} }
......
...@@ -36,7 +36,7 @@ function ImageLoader() { ...@@ -36,7 +36,7 @@ function ImageLoader() {
}); });
initPromises.push(new Promise(this.cache_.initialize.bind(this.cache_))); initPromises.push(new Promise(this.cache_.initialize.bind(this.cache_)));
// After all initializatino promises are done, start the worker. // After all initialization promises are done, start the worker.
Promise.all(initPromises).then(this.worker_.start.bind(this.worker_)); Promise.all(initPromises).then(this.worker_.start.bind(this.worker_));
// Listen for mount events, and grant permissions to volumes being mounted. // Listen for mount events, and grant permissions to volumes being mounted.
......
...@@ -22,7 +22,7 @@ window.onerror = function() { window.JSErrorCount++; }; ...@@ -22,7 +22,7 @@ window.onerror = function() { window.JSErrorCount++; };
* - Bind this object * - Bind this object
* *
* @param {Object} thisObject Object to be used as this. * @param {Object} thisObject Object to be used as this.
* @return {function} Wapped function. * @return {function} Wrapped function.
*/ */
Function.prototype.wrap = function(thisObject) { Function.prototype.wrap = function(thisObject) {
var func = this; var func = this;
......
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