summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorfukino <fukino@chromium.org>2015-07-13 23:42:07 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-14 06:42:49 +0000
commit6c290c4f816f3ee35c1de10e2c0d5d1955d87414 (patch)
tree4b8391a11e8590de144c811319566776a0b5550d /ui
parent9fa4dbc009d5d6fefa9f170921ae9adbaa977369 (diff)
downloadchromium_src-6c290c4f816f3ee35c1de10e2c0d5d1955d87414.zip
chromium_src-6c290c4f816f3ee35c1de10e2c0d5d1955d87414.tar.gz
chromium_src-6c290c4f816f3ee35c1de10e2c0d5d1955d87414.tar.bz2
Files.app: Dispatch 'drive-connection-changed' event on initialization of VolumeManagerWrapper.
VolumeManagerWrapper.getDriveConnectionState() returns 'offline' until the instance of VolumeManagerWrapper is wired to background's VolumeManager. Since the return value can be changed when it is wired to VolumeManager, we need to notify foreground components so that they update themselves based on the latest connection status. BUG=509565 TEST=manually Review URL: https://codereview.chromium.org/1240583002 Cr-Commit-Position: refs/heads/master@{#338648}
Diffstat (limited to 'ui')
-rw-r--r--ui/file_manager/file_manager/foreground/js/volume_manager_wrapper.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/file_manager/file_manager/foreground/js/volume_manager_wrapper.js b/ui/file_manager/file_manager/foreground/js/volume_manager_wrapper.js
index 7b4f53a..c2bb574 100644
--- a/ui/file_manager/file_manager/foreground/js/volume_manager_wrapper.js
+++ b/ui/file_manager/file_manager/foreground/js/volume_manager_wrapper.js
@@ -87,6 +87,11 @@ VolumeManagerWrapper.prototype.onReady_ = function(volumeManager) {
this.volumeManager_.addEventListener(
'externally-unmounted', this.onEventBound_);
+ // Dispatch 'drive-connection-changed' to listeners, since the return value of
+ // VolumeManagerWrapper.getDriveConnectionState() can be changed by setting
+ // this.volumeManager_.
+ cr.dispatchSimpleEvent(this, 'drive-connection-changed');
+
// Cache volumeInfoList.
var volumeInfoList = [];
for (var i = 0; i < this.volumeManager_.volumeInfoList.length; i++) {