Index: chrome/browser/resources/file_manager/background/js/background.js |
diff --git a/chrome/browser/resources/file_manager/background/js/background.js b/chrome/browser/resources/file_manager/background/js/background.js |
index 4c760ccf64c2b504eff1b45fef743197188c9733..94e850e3bf99bafc8b34d45769f9f7f0acc5f346 100644 |
--- a/chrome/browser/resources/file_manager/background/js/background.js |
+++ b/chrome/browser/resources/file_manager/background/js/background.js |
@@ -69,6 +69,16 @@ function Background() { |
this.deviceHandler_ = new DeviceHandler(); |
/** |
+ * Drive sync handler. |
+ * @type {DriveSyncHandler} |
+ * @private |
+ */ |
+ this.driveSyncHandler_ = new DriveSyncHandler(this.progressCenter); |
+ this.driveSyncHandler_.addEventListener( |
+ DriveSyncHandler.COMPLETED_EVENT, |
+ function() { this.tryClose(); }.bind(this)); |
+ |
+ /** |
* String assets. |
* @type {Object.<string, string>} |
*/ |
@@ -156,7 +166,8 @@ Background.prototype.ready = function(callback) { |
*/ |
Background.prototype.tryClose = function() { |
// If the file operation is going, the background page cannot close. |
- if (this.fileOperationManager.hasQueuedTasks()) { |
+ if (this.fileOperationManager.hasQueuedTasks() || |
+ this.driveSyncHandler_.syncing) { |
this.lastTimeCanClose_ = null; |
return; |
} |