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

Unified Diff: chrome/browser/extensions/extension_file_browser_private_api.cc

Issue 7706028: This is UI side unreadable device support. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 4 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/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);

Powered by Google App Engine
This is Rietveld 408576698