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

Unified Diff: chrome/browser/chromeos/drive/file_system.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.cc
diff --git a/chrome/browser/chromeos/drive/file_system.cc b/chrome/browser/chromeos/drive/file_system.cc
index eb3069ea63e7ca31076874978a8a28d4fcbbb6e1..3665383d7290dd1fdeb6b8635e7ede6a08e25e78 100644
--- a/chrome/browser/chromeos/drive/file_system.cc
+++ b/chrome/browser/chromeos/drive/file_system.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/chromeos/drive/directory_loader.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_system/copy_operation.h"
#include "chrome/browser/chromeos/drive/file_system/create_directory_operation.h"
#include "chrome/browser/chromeos/drive/file_system/create_file_operation.h"
@@ -788,9 +789,11 @@ void FileSystem::SearchMetadata(const std::string& query,
callback);
}
-void FileSystem::OnDirectoryChangedByOperation(
- const base::FilePath& directory_path) {
- OnDirectoryChanged(directory_path);
+void FileSystem::OnFileChangedByOperation(const FileChange& changed_files) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ FOR_EACH_OBSERVER(
+ FileSystemObserver, observers_, OnFileChanged(changed_files));
}
void FileSystem::OnEntryUpdatedByOperation(const std::string& local_id) {
@@ -824,11 +827,18 @@ void FileSystem::OnDriveSyncErrorAfterGetFilePath(
OnDriveSyncError(type, *file_path));
}
-void FileSystem::OnDirectoryChanged(const base::FilePath& directory_path) {
+void FileSystem::OnDirectoryReloaded(const base::FilePath& directory_path) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ FOR_EACH_OBSERVER(
+ FileSystemObserver, observers_, OnDirectoryChanged(directory_path));
+}
+
+void FileSystem::OnFileChanged(const FileChange& changed_files) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- FOR_EACH_OBSERVER(FileSystemObserver, observers_,
- OnDirectoryChanged(directory_path));
+ FOR_EACH_OBSERVER(
+ FileSystemObserver, observers_, OnFileChanged(changed_files));
}
void FileSystem::OnLoadFromServerComplete() {
« no previous file with comments | « chrome/browser/chromeos/drive/file_system.h ('k') | chrome/browser/chromeos/drive/file_system/copy_operation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698