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/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
8 #include "net/base/io_buffer.h" | 8 #include "net/base/io_buffer.h" |
9 | 9 |
10 namespace chromeos { | 10 namespace chromeos { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 metadata->name = entry_it->second->metadata->name; | 102 metadata->name = entry_it->second->metadata->name; |
103 metadata->size = entry_it->second->metadata->size; | 103 metadata->size = entry_it->second->metadata->size; |
104 metadata->modification_time = entry_it->second->metadata->modification_time; | 104 metadata->modification_time = entry_it->second->metadata->modification_time; |
105 metadata->mime_type = entry_it->second->metadata->mime_type; | 105 metadata->mime_type = entry_it->second->metadata->mime_type; |
106 metadata->thumbnail = entry_it->second->metadata->thumbnail; | 106 metadata->thumbnail = entry_it->second->metadata->thumbnail; |
107 | 107 |
108 return PostAbortableTask( | 108 return PostAbortableTask( |
109 base::Bind(callback, base::Passed(&metadata), base::File::FILE_OK)); | 109 base::Bind(callback, base::Passed(&metadata), base::File::FILE_OK)); |
110 } | 110 } |
111 | 111 |
| 112 AbortCallback FakeProvidedFileSystem::GetActions( |
| 113 const base::FilePath& entry_path, |
| 114 const ProvidedFileSystemInterface::GetActionsCallback& callback) { |
| 115 // TODO(mtomasz): Implement it once needed. |
| 116 const std::vector<Action> actions; |
| 117 return PostAbortableTask(base::Bind(callback, actions, base::File::FILE_OK)); |
| 118 } |
| 119 |
112 AbortCallback FakeProvidedFileSystem::ReadDirectory( | 120 AbortCallback FakeProvidedFileSystem::ReadDirectory( |
113 const base::FilePath& directory_path, | 121 const base::FilePath& directory_path, |
114 const storage::AsyncFileUtil::ReadDirectoryCallback& callback) { | 122 const storage::AsyncFileUtil::ReadDirectoryCallback& callback) { |
115 storage::AsyncFileUtil::EntryList entry_list; | 123 storage::AsyncFileUtil::EntryList entry_list; |
116 | 124 |
117 for (Entries::const_iterator it = entries_.begin(); it != entries_.end(); | 125 for (Entries::const_iterator it = entries_.begin(); it != entries_.end(); |
118 ++it) { | 126 ++it) { |
119 const base::FilePath file_path = it->first; | 127 const base::FilePath file_path = it->first; |
120 if (file_path == directory_path || directory_path.IsParent(file_path)) { | 128 if (file_path == directory_path || directory_path.IsParent(file_path)) { |
121 const EntryMetadata* const metadata = it->second->metadata.get(); | 129 const EntryMetadata* const metadata = it->second->metadata.get(); |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 } | 409 } |
402 | 410 |
403 void FakeProvidedFileSystem::AbortMany(const std::vector<int>& task_ids) { | 411 void FakeProvidedFileSystem::AbortMany(const std::vector<int>& task_ids) { |
404 for (size_t i = 0; i < task_ids.size(); ++i) { | 412 for (size_t i = 0; i < task_ids.size(); ++i) { |
405 tracker_.TryCancel(task_ids[i]); | 413 tracker_.TryCancel(task_ids[i]); |
406 } | 414 } |
407 } | 415 } |
408 | 416 |
409 } // namespace file_system_provider | 417 } // namespace file_system_provider |
410 } // namespace chromeos | 418 } // namespace chromeos |
OLD | NEW |