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

Unified Diff: chrome/browser/chromeos/drive/file_system/download_operation.cc

Issue 343073003: Files.app: Provide detailed change information on onDirectoryChanged event (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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/chromeos/drive/file_system/download_operation.cc
diff --git a/chrome/browser/chromeos/drive/file_system/download_operation.cc b/chrome/browser/chromeos/drive/file_system/download_operation.cc
index ba89f002951724c52ccf689267dfc2c059b97f88..ba5e25506f93f7e7313f59791f4461d3a7784787 100644
--- a/chrome/browser/chromeos/drive/file_system/download_operation.cc
+++ b/chrome/browser/chromeos/drive/file_system/download_operation.cc
@@ -12,6 +12,7 @@
#include "base/task_runner_util.h"
#include "chrome/browser/chromeos/drive/drive.pb.h"
#include "chrome/browser/chromeos/drive/file_cache.h"
+#include "chrome/browser/chromeos/drive/file_change.h"
#include "chrome/browser/chromeos/drive/file_errors.h"
#include "chrome/browser/chromeos/drive/file_system/operation_observer.h"
#include "chrome/browser/chromeos/drive/file_system_util.h"
@@ -527,9 +528,13 @@ void DownloadOperation::EnsureFileDownloadedAfterUpdateLocalState(
params->OnError(error);
return;
}
+ DCHECK(!entry_after_update->file_info().is_directory());
+ FileChange changed_files;
+ changed_files.Update(
+ file_path, FileChange::FILE_TYPE_FILE, FileChange::ADD_OR_UPDATE);
// Storing to cache changes the "offline available" status, hence notify.
- observer_->OnDirectoryChangedByOperation(file_path.DirName());
+ observer_->OnFileChangedByOperation(changed_files);
params->OnDownloadCompleted(*cache_file_path, entry_after_update.Pass());
}

Powered by Google App Engine
This is Rietveld 408576698