| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/create_directory_operation.h
" | 5 #include "chrome/browser/chromeos/drive/file_system/create_directory_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_change.h" | 8 #include "chrome/browser/chromeos/drive/file_change.h" |
| 9 #include "chrome/browser/chromeos/drive/file_system/operation_observer.h" | 9 #include "chrome/browser/chromeos/drive/file_system/operation_delegate.h" |
| 10 #include "chrome/browser/chromeos/drive/file_system_util.h" | 10 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| 11 #include "chrome/browser/chromeos/drive/resource_metadata.h" | 11 #include "chrome/browser/chromeos/drive/resource_metadata.h" |
| 12 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
| 13 | 13 |
| 14 using content::BrowserThread; | 14 using content::BrowserThread; |
| 15 | 15 |
| 16 namespace drive { | 16 namespace drive { |
| 17 namespace file_system { | 17 namespace file_system { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 entry.local_id(), | 114 entry.local_id(), |
| 115 remaining_path, | 115 remaining_path, |
| 116 updated_local_ids, | 116 updated_local_ids, |
| 117 changed_files); | 117 changed_files); |
| 118 } | 118 } |
| 119 | 119 |
| 120 } // namespace | 120 } // namespace |
| 121 | 121 |
| 122 CreateDirectoryOperation::CreateDirectoryOperation( | 122 CreateDirectoryOperation::CreateDirectoryOperation( |
| 123 base::SequencedTaskRunner* blocking_task_runner, | 123 base::SequencedTaskRunner* blocking_task_runner, |
| 124 OperationObserver* observer, | 124 OperationDelegate* delegate, |
| 125 internal::ResourceMetadata* metadata) | 125 internal::ResourceMetadata* metadata) |
| 126 : blocking_task_runner_(blocking_task_runner), | 126 : blocking_task_runner_(blocking_task_runner), |
| 127 observer_(observer), | 127 delegate_(delegate), |
| 128 metadata_(metadata), | 128 metadata_(metadata), |
| 129 weak_ptr_factory_(this) { | 129 weak_ptr_factory_(this) { |
| 130 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 130 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 131 } | 131 } |
| 132 | 132 |
| 133 CreateDirectoryOperation::~CreateDirectoryOperation() { | 133 CreateDirectoryOperation::~CreateDirectoryOperation() { |
| 134 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 134 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 135 } | 135 } |
| 136 | 136 |
| 137 void CreateDirectoryOperation::CreateDirectory( | 137 void CreateDirectoryOperation::CreateDirectory( |
| (...skipping 27 matching lines...) Expand all Loading... |
| 165 void CreateDirectoryOperation::CreateDirectoryAfterUpdateLocalState( | 165 void CreateDirectoryOperation::CreateDirectoryAfterUpdateLocalState( |
| 166 const FileOperationCallback& callback, | 166 const FileOperationCallback& callback, |
| 167 const std::set<std::string>* updated_local_ids, | 167 const std::set<std::string>* updated_local_ids, |
| 168 const FileChange* changed_files, | 168 const FileChange* changed_files, |
| 169 FileError error) { | 169 FileError error) { |
| 170 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 170 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 171 DCHECK(!callback.is_null()); | 171 DCHECK(!callback.is_null()); |
| 172 | 172 |
| 173 for (std::set<std::string>::const_iterator it = updated_local_ids->begin(); | 173 for (std::set<std::string>::const_iterator it = updated_local_ids->begin(); |
| 174 it != updated_local_ids->end(); ++it) | 174 it != updated_local_ids->end(); ++it) |
| 175 observer_->OnEntryUpdatedByOperation(*it); | 175 delegate_->OnEntryUpdatedByOperation(*it); |
| 176 | 176 |
| 177 observer_->OnFileChangedByOperation(*changed_files); | 177 delegate_->OnFileChangedByOperation(*changed_files); |
| 178 | 178 |
| 179 callback.Run(error); | 179 callback.Run(error); |
| 180 } | 180 } |
| 181 | 181 |
| 182 } // namespace file_system | 182 } // namespace file_system |
| 183 } // namespace drive | 183 } // namespace drive |
| OLD | NEW |