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