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

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

Issue 131403003: Files.app: Show drive sync state in the progress center. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. Created 6 years, 11 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
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;
}

Powered by Google App Engine
This is Rietveld 408576698