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 0459c577228c3802578cc35287bf8a29baa13abd..97189e772e469e15d4a7aeb75ddfded57b49e65c 100644 |
--- a/chrome/browser/chromeos/file_manager/volume_manager.cc |
+++ b/chrome/browser/chromeos/file_manager/volume_manager.cc |
@@ -211,13 +211,18 @@ 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; |
} |
} // namespace |
-VolumeInfo::VolumeInfo() { |
-} |
+VolumeInfo::VolumeInfo() |
+ : file_system_id(0), |
+ type(VOLUME_TYPE_GOOGLE_DRIVE), |
+ mount_condition(chromeos::disks::MOUNT_CONDITION_NONE), |
+ is_parent(false), |
+ is_read_only(false) {} |
VolumeInfo::~VolumeInfo() { |
} |
@@ -296,7 +301,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 +624,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() { |