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

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: Removed some too strict thread checks. Created 6 years, 8 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 4750b7b1b02bd038ef2367b04cb5342792bc5518..a8a4f33c36e3332c354d25a5b929fa1a80590afa 100644
--- a/chrome/browser/chromeos/file_manager/volume_manager.cc
+++ b/chrome/browser/chromeos/file_manager/volume_manager.cc
@@ -207,13 +207,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() {
}
@@ -292,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]);
@@ -615,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() {
« no previous file with comments | « chrome/browser/chromeos/file_manager/volume_manager.h ('k') | chrome/browser/chromeos/file_system_provider/observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698