diff options
author | serya@chromium.org <serya@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-10 16:20:56 +0000 |
---|---|---|
committer | serya@chromium.org <serya@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-10 16:20:56 +0000 |
commit | 139307a1aeccb134a0f3ddda64a046d0eb85b9cd (patch) | |
tree | dd1a2a41bf5b6477d3b76c4482fc1d0b145fb2f4 /chrome | |
parent | ecfc9f82557181a633c66621f9085afe13039e2a (diff) | |
download | chromium_src-139307a1aeccb134a0f3ddda64a046d0eb85b9cd.zip chromium_src-139307a1aeccb134a0f3ddda64a046d0eb85b9cd.tar.gz chromium_src-139307a1aeccb134a0f3ddda64a046d0eb85b9cd.tar.bz2 |
Fixing bug with initialization volumes.
Problem was the following. Sometimes mount completed event comes before volume list
initialized. In this case DirectoryModel sees that something has changed and the current
volume is not mounted.
Solution consists in not firing the 'change' event before the volume list has initialized.
BUG=135477
TEST=Insert and remove a USB stick several times.
Review URL: https://chromiumcodereview.appspot.com/10735031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145887 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/resources/file_manager/js/volume_manager.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/chrome/browser/resources/file_manager/js/volume_manager.js b/chrome/browser/resources/file_manager/js/volume_manager.js index 4f02c97..0a95574cc 100644 --- a/chrome/browser/resources/file_manager/js/volume_manager.js +++ b/chrome/browser/resources/file_manager/js/volume_manager.js @@ -24,8 +24,6 @@ function VolumeManager() { this.mountedVolumes_ = {}; this.initMountPoints_(); - chrome.fileBrowserPrivate.onMountCompleted.addListener( - this.onMountCompleted_.bind(this)); this.gDataStatus_ = VolumeManager.GDataStatus.UNMOUNTED; } @@ -134,6 +132,11 @@ VolumeManager.prototype.initMountPoints_ = function() { var volume = mountedVolumes[i]; self.mountedVolumes_[volume.mountPath] = volume; } + + // Subscribe to the mount completed event when mount points initialized. + chrome.fileBrowserPrivate.onMountCompleted.addListener( + self.onMountCompleted_.bind(self)); + if (mountedVolumes.length > 0) cr.dispatchSimpleEvent(self, 'change'); } |