| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/extensions/file_manager/private_api_file_syste
m.h" | 5 #include "chrome/browser/chromeos/extensions/file_manager/private_api_file_syste
m.h" |
| 6 | 6 |
| 7 #include <sys/statvfs.h> | 7 #include <sys/statvfs.h> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 &FileManagerPrivateInternalResolveIsolatedEntriesFunction:: | 797 &FileManagerPrivateInternalResolveIsolatedEntriesFunction:: |
| 798 RunAsyncAfterConvertFileDefinitionListToEntryDefinitionList, | 798 RunAsyncAfterConvertFileDefinitionListToEntryDefinitionList, |
| 799 this)); | 799 this)); |
| 800 return true; | 800 return true; |
| 801 } | 801 } |
| 802 | 802 |
| 803 void FileManagerPrivateInternalResolveIsolatedEntriesFunction:: | 803 void FileManagerPrivateInternalResolveIsolatedEntriesFunction:: |
| 804 RunAsyncAfterConvertFileDefinitionListToEntryDefinitionList(scoped_ptr< | 804 RunAsyncAfterConvertFileDefinitionListToEntryDefinitionList(scoped_ptr< |
| 805 file_manager::util::EntryDefinitionList> entry_definition_list) { | 805 file_manager::util::EntryDefinitionList> entry_definition_list) { |
| 806 using extensions::api::file_manager_private_internal::EntryDescription; | 806 using extensions::api::file_manager_private_internal::EntryDescription; |
| 807 std::vector<linked_ptr<EntryDescription> > entries; | 807 std::vector<EntryDescription> entries; |
| 808 | 808 |
| 809 for (size_t i = 0; i < entry_definition_list->size(); ++i) { | 809 for (const auto& definition : *entry_definition_list) { |
| 810 if (entry_definition_list->at(i).error != base::File::FILE_OK) | 810 if (definition.error != base::File::FILE_OK) |
| 811 continue; | 811 continue; |
| 812 linked_ptr<EntryDescription> entry(new EntryDescription); | 812 EntryDescription entry; |
| 813 entry->file_system_name = entry_definition_list->at(i).file_system_name; | 813 entry.file_system_name = definition.file_system_name; |
| 814 entry->file_system_root = entry_definition_list->at(i).file_system_root_url; | 814 entry.file_system_root = definition.file_system_root_url; |
| 815 entry->file_full_path = | 815 entry.file_full_path = "/" + definition.full_path.AsUTF8Unsafe(); |
| 816 "/" + entry_definition_list->at(i).full_path.AsUTF8Unsafe(); | 816 entry.file_is_directory = definition.is_directory; |
| 817 entry->file_is_directory = entry_definition_list->at(i).is_directory; | 817 entries.push_back(std::move(entry)); |
| 818 entries.push_back(entry); | |
| 819 } | 818 } |
| 820 | 819 |
| 821 results_ = extensions::api::file_manager_private_internal:: | 820 results_ = extensions::api::file_manager_private_internal:: |
| 822 ResolveIsolatedEntries::Results::Create(entries); | 821 ResolveIsolatedEntries::Results::Create(entries); |
| 823 SendResponse(true); | 822 SendResponse(true); |
| 824 } | 823 } |
| 825 | 824 |
| 826 FileManagerPrivateInternalComputeChecksumFunction:: | 825 FileManagerPrivateInternalComputeChecksumFunction:: |
| 827 FileManagerPrivateInternalComputeChecksumFunction() | 826 FileManagerPrivateInternalComputeChecksumFunction() |
| 828 : digester_(new drive::util::FileStreamMd5Digester()) { | 827 : digester_(new drive::util::FileStreamMd5Digester()) { |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 return RespondLater(); | 988 return RespondLater(); |
| 990 } | 989 } |
| 991 | 990 |
| 992 void FileManagerPrivateInternalSetEntryTagFunction::OnSetEntryPropertyCompleted( | 991 void FileManagerPrivateInternalSetEntryTagFunction::OnSetEntryPropertyCompleted( |
| 993 drive::FileError result) { | 992 drive::FileError result) { |
| 994 Respond(result == drive::FILE_ERROR_OK ? NoArguments() | 993 Respond(result == drive::FILE_ERROR_OK ? NoArguments() |
| 995 : Error("Failed to set a tag.")); | 994 : Error("Failed to set a tag.")); |
| 996 } | 995 } |
| 997 | 996 |
| 998 } // namespace extensions | 997 } // namespace extensions |
| OLD | NEW |