Index: chrome/browser/extensions/extension_file_browser_private_api.cc |
diff --git a/chrome/browser/extensions/extension_file_browser_private_api.cc b/chrome/browser/extensions/extension_file_browser_private_api.cc |
index f64321e82460d500ddccce9d7a640f95c8acec7c..7ba8d635d81aa923af473a6d72225dfd53d923ac 100644 |
--- a/chrome/browser/extensions/extension_file_browser_private_api.cc |
+++ b/chrome/browser/extensions/extension_file_browser_private_api.cc |
@@ -268,6 +268,8 @@ base::DictionaryValue* MountPointToValue(Profile* profile, |
mount_info->SetString("mountPath", relative_mount_path.value()); |
} |
+ mount_info->SetString("specialData", mount_point_info.special_data); |
+ |
return mount_info; |
} |
#endif |
@@ -1318,6 +1320,32 @@ void FormatDeviceFunction::GetLocalPathsResponseOnUIThread( |
SendResponse(true); |
} |
+FormatUnmountedDeviceFunction::FormatUnmountedDeviceFunction() { |
+} |
+ |
+FormatUnmountedDeviceFunction::~FormatUnmountedDeviceFunction() { |
+} |
+ |
+bool FormatUnmountedDeviceFunction::RunImpl() { |
+ if (args_->GetSize() != 1) { |
+ return false; |
+ } |
+ |
+ std::string volume_file; |
+ if (!args_->GetString(0, &volume_file)) { |
+ NOTREACHED(); |
+ return false; |
+ } |
+ |
+#ifdef OS_CHROMEOS |
+ chromeos::CrosLibrary::Get()->GetMountLibrary()->FormatUnmountedDevice( |
+ volume_file.c_str()); |
+#endif |
+ |
+ SendResponse(true); |
+ return true; |
+} |
+ |
GetVolumeMetadataFunction::GetVolumeMetadataFunction() { |
} |
@@ -1346,12 +1374,17 @@ bool GetVolumeMetadataFunction::RunImpl() { |
DictionaryValue* volume_info = new DictionaryValue(); |
result_.reset(volume_info); |
// Localising mount path. |
- FilePath relative_mount_path; |
- FileManagerUtil::ConvertFileToRelativeFileSystemPath(profile_, |
- FilePath(volume->mount_path()), &relative_mount_path); |
- |
+ std::string mount_path; |
+ if (!volume->mount_path().empty()) { |
+ FilePath relative_mount_path; |
+ FileManagerUtil::ConvertFileToRelativeFileSystemPath(profile_, |
+ FilePath(volume->mount_path()), &relative_mount_path); |
+ mount_path = relative_mount_path.value(); |
+ } else { |
+ mount_path = "unmounted"; |
+ } |
volume_info->SetString("devicePath", volume->device_path()); |
- volume_info->SetString("mountPath", relative_mount_path.value()); |
+ volume_info->SetString("mountPath", mount_path); |
volume_info->SetString("systemPath", volume->system_path()); |
volume_info->SetString("filePath", volume->file_path()); |
volume_info->SetString("deviceLabel", volume->device_label()); |
@@ -1477,6 +1510,8 @@ bool FileDialogStringsFunction::RunImpl() { |
SET_STRING(IDS_FILE_BROWSER, CONFIRM_DELETE_ONE); |
SET_STRING(IDS_FILE_BROWSER, CONFIRM_DELETE_SOME); |
+ SET_STRING(IDS_FILE_BROWSER, UNKNOWN_FILESYSTEM_WARNING); |
+ SET_STRING(IDS_FILE_BROWSER, UNSUPPORTED_FILESYSTEM_WARNING); |
SET_STRING(IDS_FILE_BROWSER, FORMATTING_WARNING); |
SET_STRING(IDS_FILE_BROWSER, SELECT_FOLDER_TITLE); |