Index: chrome/browser/chromeos/cros/mount_library.cc |
diff --git a/chrome/browser/chromeos/cros/mount_library.cc b/chrome/browser/chromeos/cros/mount_library.cc |
index 6fcbdb0e8254f3215e5efa733e01571602a41d76..d33e4a6d792637367c7f2becf9617b0a8e43c2d8 100644 |
--- a/chrome/browser/chromeos/cros/mount_library.cc |
+++ b/chrome/browser/chromeos/cros/mount_library.cc |
@@ -173,7 +173,7 @@ class MountLibraryImpl : public MountLibrary { |
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
if (!CrosLibrary::Get()->EnsureLoaded()) { |
OnMountCompleted(MOUNT_ERROR_LIBRARY_NOT_LOADED, |
- MountPointInfo(source_path, NULL, type)); |
+ MountPointInfo(source_path, NULL, type, NULL)); |
return; |
} |
libcros_proxy_->CallMountPath(source_path, type, options, |
@@ -330,9 +330,20 @@ class MountLibraryImpl : public MountLibrary { |
MountType type, |
const char* mount_path) { |
DCHECK(object); |
+ std::string special_data; |
+ if (type == MOUNT_TYPE_DEVICE) { |
+ if (error_code == MOUNT_ERROR_UNKNOWN_FILESYSTEM) |
+ special_data = "unreadable_unknown_filesystem"; |
+ if (error_code == MOUNT_ERROR_UNSUPORTED_FILESYSTEM) |
+ special_data = "unreadable_unsupported_filesystem"; |
+ } |
+ |
MountLibraryImpl* self = static_cast<MountLibraryImpl*>(object); |
self->OnMountCompleted(static_cast<MountError>(error_code), |
- MountPointInfo(source_path, mount_path, type)); |
+ MountPointInfo(source_path, |
+ mount_path, |
+ type, |
+ special_data.c_str())); |
} |
// Callback for UnmountRemovableDevice method. |
@@ -437,20 +448,14 @@ class MountLibraryImpl : public MountLibrary { |
// If the device is corrupted but it's still possible to format it, it will |
// be fake mounted. |
- // TODO(sidor): Write more general condition when it will possible. |
- bool mount_corrupted_device = |
- (error_code == MOUNT_ERROR_UNKNOWN_FILESYSTEM || |
- error_code == MOUNT_ERROR_UNSUPORTED_FILESYSTEM) && |
- mount_info.mount_type == MOUNT_TYPE_DEVICE; |
- |
- if ((error_code == MOUNT_ERROR_NONE || mount_corrupted_device) && |
+ if ((error_code == MOUNT_ERROR_NONE || !mount_info.special_data.empty()) && |
mount_points_.find(mount_info.mount_path) == mount_points_.end()) { |
mount_points_.insert(MountPointMap::value_type( |
mount_info.mount_path.c_str(), |
mount_info)); |
} |
- if ((error_code == MOUNT_ERROR_NONE || mount_corrupted_device) && |
+ if ((error_code == MOUNT_ERROR_NONE || !mount_info.special_data.empty()) && |
mount_info.mount_type == MOUNT_TYPE_DEVICE && |
!mount_info.source_path.empty() && |
!mount_info.mount_path.empty()) { |
@@ -480,7 +485,8 @@ class MountLibraryImpl : public MountLibrary { |
MOUNT_ERROR_NONE, |
MountPointInfo(mount_points_it->second.source_path.c_str(), |
mount_points_it->second.mount_path.c_str(), |
- mount_points_it->second.mount_type)); |
+ mount_points_it->second.mount_type, |
+ mount_points_it->second.special_data.c_str())); |
std::string path(mount_points_it->second.source_path); |
mount_points_.erase(mount_points_it); |
DiskMap::iterator iter = disks_.find(path); |