OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/file_system_provider/fake_provided_file_system
.h" | 5 #include "chrome/browser/chromeos/file_system_provider/fake_provided_file_system
.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 (current_offset + 1 < kFakeFileSize) && (current_length - 1); | 221 (current_offset + 1 < kFakeFileSize) && (current_length - 1); |
222 base::MessageLoopProxy::current()->PostTask( | 222 base::MessageLoopProxy::current()->PostTask( |
223 FROM_HERE, | 223 FROM_HERE, |
224 base::Bind( | 224 base::Bind( |
225 callback, 1 /* chunk_length */, has_more, base::File::FILE_OK)); | 225 callback, 1 /* chunk_length */, has_more, base::File::FILE_OK)); |
226 current_offset++; | 226 current_offset++; |
227 current_length--; | 227 current_length--; |
228 } | 228 } |
229 } | 229 } |
230 | 230 |
| 231 void FakeProvidedFileSystem::CreateDirectory( |
| 232 const base::FilePath& directory_path, |
| 233 bool exclusive, |
| 234 bool recursive, |
| 235 const fileapi::AsyncFileUtil::StatusCallback& callback) { |
| 236 base::MessageLoopProxy::current()->PostTask( |
| 237 FROM_HERE, base::Bind(callback, base::File::FILE_OK)); |
| 238 } |
| 239 |
231 const ProvidedFileSystemInfo& FakeProvidedFileSystem::GetFileSystemInfo() | 240 const ProvidedFileSystemInfo& FakeProvidedFileSystem::GetFileSystemInfo() |
232 const { | 241 const { |
233 return file_system_info_; | 242 return file_system_info_; |
234 } | 243 } |
235 | 244 |
236 RequestManager* FakeProvidedFileSystem::GetRequestManager() { | 245 RequestManager* FakeProvidedFileSystem::GetRequestManager() { |
237 NOTREACHED(); | 246 NOTREACHED(); |
238 return NULL; | 247 return NULL; |
239 } | 248 } |
240 | 249 |
241 ProvidedFileSystemInterface* FakeProvidedFileSystem::Create( | 250 ProvidedFileSystemInterface* FakeProvidedFileSystem::Create( |
242 Profile* profile, | 251 Profile* profile, |
243 const ProvidedFileSystemInfo& file_system_info) { | 252 const ProvidedFileSystemInfo& file_system_info) { |
244 return new FakeProvidedFileSystem(file_system_info); | 253 return new FakeProvidedFileSystem(file_system_info); |
245 } | 254 } |
246 | 255 |
247 base::WeakPtr<ProvidedFileSystemInterface> | 256 base::WeakPtr<ProvidedFileSystemInterface> |
248 FakeProvidedFileSystem::GetWeakPtr() { | 257 FakeProvidedFileSystem::GetWeakPtr() { |
249 return weak_ptr_factory_.GetWeakPtr(); | 258 return weak_ptr_factory_.GetWeakPtr(); |
250 } | 259 } |
251 | 260 |
252 } // namespace file_system_provider | 261 } // namespace file_system_provider |
253 } // namespace chromeos | 262 } // namespace chromeos |
OLD | NEW |