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

Side by Side 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, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/drive/file_system.h" 5 #include "chrome/browser/chromeos/drive/file_system.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "chrome/browser/chromeos/drive/change_list_loader.h" 10 #include "chrome/browser/chromeos/drive/change_list_loader.h"
11 #include "chrome/browser/chromeos/drive/directory_loader.h" 11 #include "chrome/browser/chromeos/drive/directory_loader.h"
12 #include "chrome/browser/chromeos/drive/drive.pb.h" 12 #include "chrome/browser/chromeos/drive/drive.pb.h"
13 #include "chrome/browser/chromeos/drive/file_cache.h" 13 #include "chrome/browser/chromeos/drive/file_cache.h"
14 #include "chrome/browser/chromeos/drive/file_change.h"
14 #include "chrome/browser/chromeos/drive/file_system/copy_operation.h" 15 #include "chrome/browser/chromeos/drive/file_system/copy_operation.h"
15 #include "chrome/browser/chromeos/drive/file_system/create_directory_operation.h " 16 #include "chrome/browser/chromeos/drive/file_system/create_directory_operation.h "
16 #include "chrome/browser/chromeos/drive/file_system/create_file_operation.h" 17 #include "chrome/browser/chromeos/drive/file_system/create_file_operation.h"
17 #include "chrome/browser/chromeos/drive/file_system/download_operation.h" 18 #include "chrome/browser/chromeos/drive/file_system/download_operation.h"
18 #include "chrome/browser/chromeos/drive/file_system/get_file_for_saving_operatio n.h" 19 #include "chrome/browser/chromeos/drive/file_system/get_file_for_saving_operatio n.h"
19 #include "chrome/browser/chromeos/drive/file_system/move_operation.h" 20 #include "chrome/browser/chromeos/drive/file_system/move_operation.h"
20 #include "chrome/browser/chromeos/drive/file_system/open_file_operation.h" 21 #include "chrome/browser/chromeos/drive/file_system/open_file_operation.h"
21 #include "chrome/browser/chromeos/drive/file_system/remove_operation.h" 22 #include "chrome/browser/chromeos/drive/file_system/remove_operation.h"
22 #include "chrome/browser/chromeos/drive/file_system/search_operation.h" 23 #include "chrome/browser/chromeos/drive/file_system/search_operation.h"
23 #include "chrome/browser/chromeos/drive/file_system/touch_operation.h" 24 #include "chrome/browser/chromeos/drive/file_system/touch_operation.h"
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 options |= SEARCH_METADATA_EXCLUDE_HOSTED_DOCUMENTS; 782 options |= SEARCH_METADATA_EXCLUDE_HOSTED_DOCUMENTS;
782 783
783 drive::internal::SearchMetadata(blocking_task_runner_, 784 drive::internal::SearchMetadata(blocking_task_runner_,
784 resource_metadata_, 785 resource_metadata_,
785 query, 786 query,
786 options, 787 options,
787 at_most_num_matches, 788 at_most_num_matches,
788 callback); 789 callback);
789 } 790 }
790 791
791 void FileSystem::OnDirectoryChangedByOperation( 792 void FileSystem::OnFileChangedByOperation(const FileChange& changed_files) {
792 const base::FilePath& directory_path) { 793 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
793 OnDirectoryChanged(directory_path); 794
795 FOR_EACH_OBSERVER(
796 FileSystemObserver, observers_, OnFileChanged(changed_files));
794 } 797 }
795 798
796 void FileSystem::OnEntryUpdatedByOperation(const std::string& local_id) { 799 void FileSystem::OnEntryUpdatedByOperation(const std::string& local_id) {
797 sync_client_->AddUpdateTask(ClientContext(USER_INITIATED), local_id); 800 sync_client_->AddUpdateTask(ClientContext(USER_INITIATED), local_id);
798 } 801 }
799 802
800 void FileSystem::OnDriveSyncError(file_system::DriveSyncErrorType type, 803 void FileSystem::OnDriveSyncError(file_system::DriveSyncErrorType type,
801 const std::string& local_id) { 804 const std::string& local_id) {
802 base::FilePath* file_path = new base::FilePath; 805 base::FilePath* file_path = new base::FilePath;
803 base::PostTaskAndReplyWithResult( 806 base::PostTaskAndReplyWithResult(
(...skipping 13 matching lines...) Expand all
817 file_system::DriveSyncErrorType type, 820 file_system::DriveSyncErrorType type,
818 const base::FilePath* file_path, 821 const base::FilePath* file_path,
819 FileError error) { 822 FileError error) {
820 if (error != FILE_ERROR_OK) 823 if (error != FILE_ERROR_OK)
821 return; 824 return;
822 FOR_EACH_OBSERVER(FileSystemObserver, 825 FOR_EACH_OBSERVER(FileSystemObserver,
823 observers_, 826 observers_,
824 OnDriveSyncError(type, *file_path)); 827 OnDriveSyncError(type, *file_path));
825 } 828 }
826 829
827 void FileSystem::OnDirectoryChanged(const base::FilePath& directory_path) { 830 void FileSystem::OnDirectoryReloaded(const base::FilePath& directory_path) {
828 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 831 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
829 832
830 FOR_EACH_OBSERVER(FileSystemObserver, observers_, 833 FOR_EACH_OBSERVER(
831 OnDirectoryChanged(directory_path)); 834 FileSystemObserver, observers_, OnDirectoryChanged(directory_path));
835 }
836
837 void FileSystem::OnFileChanged(const FileChange& changed_files) {
838 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
839
840 FOR_EACH_OBSERVER(
841 FileSystemObserver, observers_, OnFileChanged(changed_files));
832 } 842 }
833 843
834 void FileSystem::OnLoadFromServerComplete() { 844 void FileSystem::OnLoadFromServerComplete() {
835 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 845 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
836 846
837 sync_client_->StartCheckingExistingPinnedFiles(); 847 sync_client_->StartCheckingExistingPinnedFiles();
838 } 848 }
839 849
840 void FileSystem::OnInitialLoadComplete() { 850 void FileSystem::OnInitialLoadComplete() {
841 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 851 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 FROM_HERE, 984 FROM_HERE,
975 base::Bind(&GetPathFromResourceIdOnBlockingPool, 985 base::Bind(&GetPathFromResourceIdOnBlockingPool,
976 resource_metadata_, 986 resource_metadata_,
977 resource_id, 987 resource_id,
978 file_path), 988 file_path),
979 base::Bind(&GetPathFromResourceIdAfterGetPath, 989 base::Bind(&GetPathFromResourceIdAfterGetPath,
980 base::Owned(file_path), 990 base::Owned(file_path),
981 callback)); 991 callback));
982 } 992 }
983 } // namespace drive 993 } // namespace drive
OLDNEW
« 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