Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(707)

Unified Diff: chrome/browser/extensions/api/file_system/file_system_api.cc

Issue 1829783002: [Extensions] Convert APIs to use movable types [5] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/file_system/file_system_api.cc
diff --git a/chrome/browser/extensions/api/file_system/file_system_api.cc b/chrome/browser/extensions/api/file_system/file_system_api.cc
index 3484b174d7ed999b493e9c7ad792c36b3b7f4800..c20677185c0b120d198f71314768100d55a99efe 100644
--- a/chrome/browser/extensions/api/file_system/file_system_api.cc
+++ b/chrome/browser/extensions/api/file_system/file_system_api.cc
@@ -256,19 +256,18 @@ content::WebContents* GetWebContentsForAppId(Profile* profile,
// Fills a list of volumes mounted in the system.
void FillVolumeList(Profile* profile,
- std::vector<linked_ptr<api::file_system::Volume>>* result) {
- using file_manager::VolumeManager;
- VolumeManager* const volume_manager = VolumeManager::Get(profile);
+ std::vector<api::file_system::Volume>* result) {
+ file_manager::VolumeManager* const volume_manager =
+ file_manager::VolumeManager::Get(profile);
DCHECK(volume_manager);
- using api::file_system::Volume;
const auto& volume_list = volume_manager->GetVolumeList();
// Convert volume_list to result_volume_list.
for (const auto& volume : volume_list) {
- const linked_ptr<Volume> result_volume(new Volume);
- result_volume->volume_id = volume->volume_id();
- result_volume->writable = !volume->is_read_only();
- result->push_back(result_volume);
+ api::file_system::Volume result_volume;
+ result_volume.volume_id = volume->volume_id();
+ result_volume.writable = !volume->is_read_only();
+ result->push_back(std::move(result_volume));
}
}
#endif
@@ -979,13 +978,11 @@ void FileSystemChooseEntryFunction::BuildFileTypeInfo(
!suggested_extension.empty();
if (accepts) {
- typedef file_system::AcceptOption AcceptOption;
- for (std::vector<linked_ptr<AcceptOption> >::const_iterator iter =
- accepts->begin(); iter != accepts->end(); ++iter) {
+ for (const file_system::AcceptOption& option : *accepts) {
base::string16 description;
std::vector<base::FilePath::StringType> extensions;
- if (!GetFileTypesFromAcceptOption(**iter, &extensions, &description))
+ if (!GetFileTypesFromAcceptOption(option, &extensions, &description))
continue; // No extensions were found.
file_type_info->extensions.push_back(extensions);
@@ -1448,8 +1445,7 @@ ExtensionFunction::ResponseAction FileSystemGetVolumeListFunction::Run() {
if (!consent_provider.IsGrantable(*extension()))
return RespondNow(Error(kNotSupportedOnNonKioskSessionError));
- using api::file_system::Volume;
- std::vector<linked_ptr<Volume>> result_volume_list;
+ std::vector<api::file_system::Volume> result_volume_list;
FillVolumeList(chrome_details_.GetProfile(), &result_volume_list);
return RespondNow(ArgumentList(

Powered by Google App Engine
This is Rietveld 408576698