| 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 "base/files/file.h" | 7 #include "base/files/file.h" |
| 8 #include "base/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
| 9 #include "net/base/io_buffer.h" | 9 #include "net/base/io_buffer.h" |
| 10 | 10 |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 FakeProvidedFileSystem::ObserveDirectory( | 325 FakeProvidedFileSystem::ObserveDirectory( |
| 326 const base::FilePath& directory_path, | 326 const base::FilePath& directory_path, |
| 327 bool recursive, | 327 bool recursive, |
| 328 const storage::AsyncFileUtil::StatusCallback& callback) { | 328 const storage::AsyncFileUtil::StatusCallback& callback) { |
| 329 // TODO(mtomasz): Implement it once needed. | 329 // TODO(mtomasz): Implement it once needed. |
| 330 return PostAbortableTask(base::Bind(callback, base::File::FILE_OK)); | 330 return PostAbortableTask(base::Bind(callback, base::File::FILE_OK)); |
| 331 } | 331 } |
| 332 | 332 |
| 333 void FakeProvidedFileSystem::UnobserveEntry( | 333 void FakeProvidedFileSystem::UnobserveEntry( |
| 334 const base::FilePath& entry_path, | 334 const base::FilePath& entry_path, |
| 335 bool recursive, |
| 335 const storage::AsyncFileUtil::StatusCallback& callback) { | 336 const storage::AsyncFileUtil::StatusCallback& callback) { |
| 336 // TODO(mtomasz): Implement it once needed. | 337 // TODO(mtomasz): Implement it once needed. |
| 337 callback.Run(base::File::FILE_OK); | 338 callback.Run(base::File::FILE_OK); |
| 338 } | 339 } |
| 339 | 340 |
| 340 const ProvidedFileSystemInfo& FakeProvidedFileSystem::GetFileSystemInfo() | 341 const ProvidedFileSystemInfo& FakeProvidedFileSystem::GetFileSystemInfo() |
| 341 const { | 342 const { |
| 342 return file_system_info_; | 343 return file_system_info_; |
| 343 } | 344 } |
| 344 | 345 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 357 } | 358 } |
| 358 | 359 |
| 359 void FakeProvidedFileSystem::RemoveObserver( | 360 void FakeProvidedFileSystem::RemoveObserver( |
| 360 ProvidedFileSystemObserver* observer) { | 361 ProvidedFileSystemObserver* observer) { |
| 361 DCHECK(observer); | 362 DCHECK(observer); |
| 362 observers_.RemoveObserver(observer); | 363 observers_.RemoveObserver(observer); |
| 363 } | 364 } |
| 364 | 365 |
| 365 bool FakeProvidedFileSystem::Notify( | 366 bool FakeProvidedFileSystem::Notify( |
| 366 const base::FilePath& observed_path, | 367 const base::FilePath& observed_path, |
| 368 bool recursive, |
| 367 ProvidedFileSystemObserver::ChangeType change_type, | 369 ProvidedFileSystemObserver::ChangeType change_type, |
| 368 scoped_ptr<ProvidedFileSystemObserver::ChildChanges> child_changes, | 370 scoped_ptr<ProvidedFileSystemObserver::Changes> changes, |
| 369 const std::string& tag) { | 371 const std::string& tag) { |
| 370 NOTREACHED(); | 372 NOTREACHED(); |
| 371 return false; | 373 return false; |
| 372 } | 374 } |
| 373 | 375 |
| 374 ProvidedFileSystemInterface* FakeProvidedFileSystem::Create( | 376 ProvidedFileSystemInterface* FakeProvidedFileSystem::Create( |
| 375 Profile* profile, | 377 Profile* profile, |
| 376 const ProvidedFileSystemInfo& file_system_info) { | 378 const ProvidedFileSystemInfo& file_system_info) { |
| 377 return new FakeProvidedFileSystem(file_system_info); | 379 return new FakeProvidedFileSystem(file_system_info); |
| 378 } | 380 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 401 const std::vector<int>& task_ids, | 403 const std::vector<int>& task_ids, |
| 402 const storage::AsyncFileUtil::StatusCallback& callback) { | 404 const storage::AsyncFileUtil::StatusCallback& callback) { |
| 403 for (size_t i = 0; i < task_ids.size(); ++i) { | 405 for (size_t i = 0; i < task_ids.size(); ++i) { |
| 404 tracker_.TryCancel(task_ids[i]); | 406 tracker_.TryCancel(task_ids[i]); |
| 405 } | 407 } |
| 406 callback.Run(base::File::FILE_OK); | 408 callback.Run(base::File::FILE_OK); |
| 407 } | 409 } |
| 408 | 410 |
| 409 } // namespace file_system_provider | 411 } // namespace file_system_provider |
| 410 } // namespace chromeos | 412 } // namespace chromeos |
| OLD | NEW |