OLD | NEW |
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/platform_file.h" | 9 #include "base/platform_file.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 open_file_operation_.reset( | 290 open_file_operation_.reset( |
291 new file_system::OpenFileOperation(blocking_task_runner_.get(), | 291 new file_system::OpenFileOperation(blocking_task_runner_.get(), |
292 observer, | 292 observer, |
293 scheduler_, | 293 scheduler_, |
294 resource_metadata_, | 294 resource_metadata_, |
295 cache_, | 295 cache_, |
296 temporary_file_directory_)); | 296 temporary_file_directory_)); |
297 remove_operation_.reset( | 297 remove_operation_.reset( |
298 new file_system::RemoveOperation(blocking_task_runner_.get(), | 298 new file_system::RemoveOperation(blocking_task_runner_.get(), |
299 observer, | 299 observer, |
300 scheduler_, | |
301 resource_metadata_, | 300 resource_metadata_, |
302 cache_)); | 301 cache_)); |
303 touch_operation_.reset(new file_system::TouchOperation( | 302 touch_operation_.reset(new file_system::TouchOperation( |
304 blocking_task_runner_.get(), observer, scheduler_, resource_metadata_)); | 303 blocking_task_runner_.get(), observer, scheduler_, resource_metadata_)); |
305 truncate_operation_.reset( | 304 truncate_operation_.reset( |
306 new file_system::TruncateOperation(blocking_task_runner_.get(), | 305 new file_system::TruncateOperation(blocking_task_runner_.get(), |
307 observer, | 306 observer, |
308 scheduler_, | 307 scheduler_, |
309 resource_metadata_, | 308 resource_metadata_, |
310 cache_, | 309 cache_, |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 void FileSystem::OnDirectoryChangedByOperation( | 878 void FileSystem::OnDirectoryChangedByOperation( |
880 const base::FilePath& directory_path) { | 879 const base::FilePath& directory_path) { |
881 OnDirectoryChanged(directory_path); | 880 OnDirectoryChanged(directory_path); |
882 } | 881 } |
883 | 882 |
884 void FileSystem::OnCacheFileUploadNeededByOperation( | 883 void FileSystem::OnCacheFileUploadNeededByOperation( |
885 const std::string& local_id) { | 884 const std::string& local_id) { |
886 sync_client_->AddUploadTask(ClientContext(USER_INITIATED), local_id); | 885 sync_client_->AddUploadTask(ClientContext(USER_INITIATED), local_id); |
887 } | 886 } |
888 | 887 |
| 888 void FileSystem::OnEntryRemovedByOperation(const std::string& local_id) { |
| 889 sync_client_->AddRemoveTask(local_id); |
| 890 } |
| 891 |
889 void FileSystem::OnDirectoryChanged(const base::FilePath& directory_path) { | 892 void FileSystem::OnDirectoryChanged(const base::FilePath& directory_path) { |
890 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 893 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
891 | 894 |
892 FOR_EACH_OBSERVER(FileSystemObserver, observers_, | 895 FOR_EACH_OBSERVER(FileSystemObserver, observers_, |
893 OnDirectoryChanged(directory_path)); | 896 OnDirectoryChanged(directory_path)); |
894 } | 897 } |
895 | 898 |
896 void FileSystem::OnLoadFromServerComplete() { | 899 void FileSystem::OnLoadFromServerComplete() { |
897 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 900 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
898 | 901 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 OpenMode open_mode, | 989 OpenMode open_mode, |
987 const std::string& mime_type, | 990 const std::string& mime_type, |
988 const OpenFileCallback& callback) { | 991 const OpenFileCallback& callback) { |
989 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 992 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
990 DCHECK(!callback.is_null()); | 993 DCHECK(!callback.is_null()); |
991 | 994 |
992 open_file_operation_->OpenFile(file_path, open_mode, mime_type, callback); | 995 open_file_operation_->OpenFile(file_path, open_mode, mime_type, callback); |
993 } | 996 } |
994 | 997 |
995 } // namespace drive | 998 } // namespace drive |
OLD | NEW |