| Index: chrome/browser/chromeos/file_manager/volume_manager.cc
|
| diff --git a/chrome/browser/chromeos/file_manager/volume_manager.cc b/chrome/browser/chromeos/file_manager/volume_manager.cc
|
| index a2feaa0a90190d37b9bc31d5b892fa63869325f1..aa0edf41df01a802e894dd8043da2f89cd6a2533 100644
|
| --- a/chrome/browser/chromeos/file_manager/volume_manager.cc
|
| +++ b/chrome/browser/chromeos/file_manager/volume_manager.cc
|
| @@ -211,6 +211,7 @@ VolumeInfo CreateProvidedFileSystemVolumeInfo(
|
| volume_info.is_parent = true;
|
| volume_info.is_read_only = true;
|
| volume_info.volume_id = GenerateVolumeId(volume_info);
|
| + volume_info.file_system_id = file_system.file_system_id();
|
| return volume_info;
|
| }
|
|
|
| @@ -296,7 +297,7 @@ void VolumeManager::Initialize() {
|
| file_system_provider_service_->AddObserver(this);
|
|
|
| std::vector<ProvidedFileSystem> provided_file_systems =
|
| - file_system_provider_service_->GetRegisteredFileSystems();
|
| + file_system_provider_service_->GetMountedFileSystems();
|
| for (size_t i = 0; i < provided_file_systems.size(); ++i) {
|
| VolumeInfo volume_info =
|
| CreateProvidedFileSystemVolumeInfo(provided_file_systems[i]);
|
| @@ -619,16 +620,28 @@ void VolumeManager::OnFormatEvent(
|
| NOTREACHED();
|
| }
|
|
|
| -void VolumeManager::OnProvidedFileSystemRegistered(
|
| - const chromeos::file_system_provider::ProvidedFileSystem& file_system) {
|
| +void VolumeManager::OnProvidedFileSystemMount(
|
| + const chromeos::file_system_provider::ProvidedFileSystem& file_system,
|
| + base::File::Error error) {
|
| VolumeInfo volume_info = CreateProvidedFileSystemVolumeInfo(file_system);
|
| - DoMountEvent(chromeos::MOUNT_ERROR_NONE, volume_info, false /* remounting */);
|
| -}
|
| -
|
| -void VolumeManager::OnProvidedFileSystemUnregistered(
|
| - const chromeos::file_system_provider::ProvidedFileSystem& file_system) {
|
| + // TODO(mtomasz): Introduce own type, and avoid using MountError internally,
|
| + // since it is related to cros disks only.
|
| + const chromeos::MountError mount_error = error == base::File::FILE_OK
|
| + ? chromeos::MOUNT_ERROR_NONE
|
| + : chromeos::MOUNT_ERROR_UNKNOWN;
|
| + DoMountEvent(mount_error, volume_info, false /* remounting */);
|
| +}
|
| +
|
| +void VolumeManager::OnProvidedFileSystemUnmount(
|
| + const chromeos::file_system_provider::ProvidedFileSystem& file_system,
|
| + base::File::Error error) {
|
| + // TODO(mtomasz): Introduce own type, and avoid using MountError internally,
|
| + // since it is related to cros disks only.
|
| + const chromeos::MountError mount_error = error == base::File::FILE_OK
|
| + ? chromeos::MOUNT_ERROR_NONE
|
| + : chromeos::MOUNT_ERROR_UNKNOWN;
|
| VolumeInfo volume_info = CreateProvidedFileSystemVolumeInfo(file_system);
|
| - DoUnmountEvent(chromeos::MOUNT_ERROR_NONE, volume_info);
|
| + DoUnmountEvent(mount_error, volume_info);
|
| }
|
|
|
| void VolumeManager::OnExternalStorageDisabledChanged() {
|
|
|