Chromium Code Reviews| 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..24216aeda0483f3925e9447999c33796d332bbc0 100644 |
| --- a/chrome/browser/extensions/extension_file_browser_private_api.cc |
| +++ b/chrome/browser/extensions/extension_file_browser_private_api.cc |
| @@ -268,6 +268,10 @@ base::DictionaryValue* MountPointToValue(Profile* profile, |
| mount_info->SetString("mountPath", relative_mount_path.value()); |
| } |
| + mount_info->SetString("mountCondition", |
| + chromeos::MountLibrary::MountConditionToString( |
| + mount_point_info.mount_condition)); |
| + |
| return mount_info; |
| } |
| #endif |
| @@ -1318,6 +1322,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 +1376,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 = ""; |
|
tbarzic
2011/08/25 02:03:44
you don't need else part... mount_path is set to "
sidor
2011/08/25 18:02:13
Yes, sorry for that. That what happens when you re
|
| + } |
| 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 +1512,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); |