| 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/fake_file_system.h" | 5 #include "chrome/browser/chromeos/drive/fake_file_system.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 139 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 140 } | 140 } |
| 141 | 141 |
| 142 void FakeFileSystem::GetFileByPath(const base::FilePath& file_path, | 142 void FakeFileSystem::GetFileByPath(const base::FilePath& file_path, |
| 143 const GetFileCallback& callback) { | 143 const GetFileCallback& callback) { |
| 144 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 144 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 145 } | 145 } |
| 146 | 146 |
| 147 void FakeFileSystem::GetFileByResourceId( | 147 void FakeFileSystem::GetFileByResourceId( |
| 148 const std::string& resource_id, | 148 const std::string& resource_id, |
| 149 const DriveClientContext& context, | 149 const ClientContext& context, |
| 150 const GetFileCallback& get_file_callback, | 150 const GetFileCallback& get_file_callback, |
| 151 const google_apis::GetContentCallback& get_content_callback) { | 151 const google_apis::GetContentCallback& get_content_callback) { |
| 152 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 152 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 153 } | 153 } |
| 154 | 154 |
| 155 void FakeFileSystem::GetFileContentByPath( | 155 void FakeFileSystem::GetFileContentByPath( |
| 156 const base::FilePath& file_path, | 156 const base::FilePath& file_path, |
| 157 const GetFileContentInitializedCallback& initialized_callback, | 157 const GetFileContentInitializedCallback& initialized_callback, |
| 158 const google_apis::GetContentCallback& get_content_callback, | 158 const google_apis::GetContentCallback& get_content_callback, |
| 159 const FileOperationCallback& completion_callback) { | 159 const FileOperationCallback& completion_callback) { |
| 160 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 160 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 161 | 161 |
| 162 GetResourceEntryByPath( | 162 GetResourceEntryByPath( |
| 163 file_path, | 163 file_path, |
| 164 base::Bind(&FakeFileSystem::GetFileContentByPathAfterGetResourceEntry, | 164 base::Bind(&FakeFileSystem::GetFileContentByPathAfterGetResourceEntry, |
| 165 weak_ptr_factory_.GetWeakPtr(), | 165 weak_ptr_factory_.GetWeakPtr(), |
| 166 file_path, initialized_callback, get_content_callback, | 166 file_path, initialized_callback, get_content_callback, |
| 167 completion_callback)); | 167 completion_callback)); |
| 168 } | 168 } |
| 169 | 169 |
| 170 void FakeFileSystem::UpdateFileByResourceId( | 170 void FakeFileSystem::UpdateFileByResourceId( |
| 171 const std::string& resource_id, | 171 const std::string& resource_id, |
| 172 const DriveClientContext& context, | 172 const ClientContext& context, |
| 173 const FileOperationCallback& callback) { | 173 const FileOperationCallback& callback) { |
| 174 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 174 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 175 } | 175 } |
| 176 | 176 |
| 177 void FakeFileSystem::GetResourceEntryByPath( | 177 void FakeFileSystem::GetResourceEntryByPath( |
| 178 const base::FilePath& file_path, | 178 const base::FilePath& file_path, |
| 179 const GetResourceEntryCallback& callback) { | 179 const GetResourceEntryCallback& callback) { |
| 180 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 180 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 181 | 181 |
| 182 // Now, we only support files under my drive. | 182 // Now, we only support files under my drive. |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 callback.Run(FILE_ERROR_OK, entry.Pass()); | 510 callback.Run(FILE_ERROR_OK, entry.Pass()); |
| 511 return; | 511 return; |
| 512 } | 512 } |
| 513 } | 513 } |
| 514 | 514 |
| 515 callback.Run(FILE_ERROR_NOT_FOUND, scoped_ptr<ResourceEntry>()); | 515 callback.Run(FILE_ERROR_NOT_FOUND, scoped_ptr<ResourceEntry>()); |
| 516 } | 516 } |
| 517 | 517 |
| 518 } // namespace test_util | 518 } // namespace test_util |
| 519 } // namespace drive | 519 } // namespace drive |
| OLD | NEW |