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

Unified Diff: chrome/browser/chromeos/file_manager/volume_manager.cc

Issue 194693002: [fsp] Add requestUnmount() method together with the request manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 6 years, 9 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/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() {

Powered by Google App Engine
This is Rietveld 408576698