| 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/remove_operation.h" | 5 #include "chrome/browser/chromeos/drive/file_system/remove_operation.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chromeos/drive/drive.pb.h" | 7 #include "chrome/browser/chromeos/drive/drive.pb.h" |
| 8 #include "chrome/browser/chromeos/drive/file_cache.h" | 8 #include "chrome/browser/chromeos/drive/file_cache.h" |
| 9 #include "chrome/browser/chromeos/drive/file_system/operation_observer.h" | 9 #include "chrome/browser/chromeos/drive/file_system/operation_observer.h" |
| 10 #include "chrome/browser/chromeos/drive/file_system_util.h" | 10 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 if (error != FILE_ERROR_OK) { | 87 if (error != FILE_ERROR_OK) { |
| 88 callback.Run(error); | 88 callback.Run(error); |
| 89 return; | 89 return; |
| 90 } | 90 } |
| 91 | 91 |
| 92 metadata_->RemoveEntry(resource_id, | 92 metadata_->RemoveEntry(resource_id, |
| 93 base::Bind(&RemoveOperation::NotifyDirectoryChanged, | 93 base::Bind(&RemoveOperation::NotifyDirectoryChanged, |
| 94 weak_ptr_factory_.GetWeakPtr(), | 94 weak_ptr_factory_.GetWeakPtr(), |
| 95 callback)); | 95 callback)); |
| 96 | 96 |
| 97 cache_->Remove(resource_id, base::Bind(&EmptyFileOperationCallback)); | 97 cache_->RemoveOnUIThread(resource_id, |
| 98 base::Bind(&EmptyFileOperationCallback)); |
| 98 } | 99 } |
| 99 | 100 |
| 100 void RemoveOperation::NotifyDirectoryChanged( | 101 void RemoveOperation::NotifyDirectoryChanged( |
| 101 const FileOperationCallback& callback, | 102 const FileOperationCallback& callback, |
| 102 FileError error, | 103 FileError error, |
| 103 const base::FilePath& directory_path) { | 104 const base::FilePath& directory_path) { |
| 104 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 105 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 105 DCHECK(!callback.is_null()); | 106 DCHECK(!callback.is_null()); |
| 106 | 107 |
| 107 if (error == FILE_ERROR_OK) | 108 if (error == FILE_ERROR_OK) |
| 108 observer_->OnDirectoryChangedByOperation(directory_path); | 109 observer_->OnDirectoryChangedByOperation(directory_path); |
| 109 | 110 |
| 110 callback.Run(error); | 111 callback.Run(error); |
| 111 } | 112 } |
| 112 | 113 |
| 113 } // namespace file_system | 114 } // namespace file_system |
| 114 } // namespace drive | 115 } // namespace drive |
| OLD | NEW |