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

Unified Diff: chrome/browser/resources/file_manager/js/file_manager.js

Issue 10252005: [File Manager] Fixed an exception when ejecting a removable drive. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/js/file_manager.js
diff --git a/chrome/browser/resources/file_manager/js/file_manager.js b/chrome/browser/resources/file_manager/js/file_manager.js
index 12a77ad1676596f5a6ccae2ddb52810b1c4e789e..11627d0dff493c2dd84a09ac224d7d0bfc89b747 100644
--- a/chrome/browser/resources/file_manager/js/file_manager.js
+++ b/chrome/browser/resources/file_manager/js/file_manager.js
@@ -2543,8 +2543,6 @@ FileManager.prototype = {
* Event handler called when some volume was mounted or unmouted.
*/
FileManager.prototype.onMountCompleted_ = function(event) {
- var self = this;
-
var changeDirectoryTo = null;
if (event && event.mountType == 'gdata') {
@@ -2583,21 +2581,21 @@ FileManager.prototype = {
}
chrome.fileBrowserPrivate.getMountPoints(function(mountPoints) {
- self.setMountPoints_(mountPoints);
+ this.setMountPoints_(mountPoints);
if (event.eventType == 'mount') {
// Mount request finished - remove it.
// Currently we only request mounts for archive files.
- var index = self.mountRequests_.indexOf(event.sourceUrl);
+ var index = this.mountRequests_.indexOf(event.sourceUrl);
if (index != -1) {
- self.mountRequests_.splice(index, 1);
+ this.mountRequests_.splice(index, 1);
if (event.status == 'success') {
// Successful mount requested from this tab, go to the drive root.
changeDirectoryTo = event.mountPath;
} else {
// Request initiated from this tab failed, report the error.
var fileName = event.sourceUrl.split('/').pop();
- self.alert.show(
+ this.alert.show(
strf('ARCHIVE_MOUNT_FAILED', fileName, event.status));
}
}
@@ -2605,16 +2603,16 @@ FileManager.prototype = {
if (event.eventType == 'unmount') {
// Unmount request finished - remove it.
- var index = self.unmountRequests_.indexOf(event.mountPath);
+ var index = this.unmountRequests_.indexOf(event.mountPath);
if (index != -1) {
- self.unmountRequests_.splice(index, 1);
+ this.unmountRequests_.splice(index, 1);
if (event.status != 'success')
- self.alert.show(strf('UNMOUNT_FAILED', event.status));
+ this.alert.show(strf('UNMOUNT_FAILED', event.status));
}
if (event.status == 'success' &&
- event.mountPath == self.directoryModel_.getCurrentRootPath()) {
- if (self.params_.mountTriggered && index == -1) {
+ event.mountPath == this.directoryModel_.getCurrentRootPath()) {
+ if (this.params_.mountTriggered && index == -1) {
// This device mount was the reason this File Manager instance was
// created. Now the device is unmounted from another instance
// or the user removed the device manually. Close this instance.
@@ -2632,12 +2630,12 @@ FileManager.prototype = {
// Even if something failed root list should be rescanned.
// Failed mounts can "give" us new devices which might be formatted,
// so we have to refresh root list then.
- self.directoryModel_.updateRoots(function() {
+ this.directoryModel_.updateRoots(function() {
if (changeDirectoryTo) {
- self.directoryModel_.changeDirectory(changeDirectoryTo);
+ this.directoryModel_.changeDirectory(changeDirectoryTo);
}
- }, self.gdataMounted_);
- });
+ }.bind(this), this.gdataMounted_);
+ }.bind(this));
};
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698