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

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

Issue 1093383002: [WIP] Provided file system from NACL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved several modules to chromeos folder. Created 5 years, 5 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 2026e431cd49a1a1f2713e456f7e7d9d31b62a47..17a18eac724fecd02b8d80ee2bd2014c084b34a3 100644
--- a/chrome/browser/chromeos/file_manager/volume_manager.cc
+++ b/chrome/browser/chromeos/file_manager/volume_manager.cc
@@ -110,6 +110,8 @@ std::string VolumeTypeToString(VolumeType type) {
return "mtp";
case VOLUME_TYPE_TESTING:
return "testing";
+ case VOLUME_TYPE_PLUGIN_PROVIDED:
+ return "plugin_provided";
case NUM_VOLUME_TYPE:
break;
}
@@ -224,8 +226,10 @@ Volume* Volume::CreateForProvidedFileSystem(
volume->source_ = SOURCE_NETWORK;
break;
}
+ using chromeos::file_system_provider::Source_Type;
volume->volume_label_ = file_system_info.display_name();
- volume->type_ = VOLUME_TYPE_PROVIDED;
+ volume->type_ = file_system_info.source_type() == Source_Type::plugin ?
+ VOLUME_TYPE_PLUGIN_PROVIDED : VOLUME_TYPE_PROVIDED;
volume->mount_path_ = file_system_info.mount_path();
volume->mount_condition_ = chromeos::disks::MOUNT_CONDITION_NONE;
volume->mount_context_ = mount_context;
@@ -280,17 +284,19 @@ Volume* Volume::CreateForTesting(const base::FilePath& device_path,
return volume;
}
-VolumeManager::VolumeManager(
- Profile* profile,
+VolumeManager::VolumeManager(Profile* profile,
drive::DriveIntegrationService* drive_integration_service,
chromeos::PowerManagerClient* power_manager_client,
chromeos::disks::DiskMountManager* disk_mount_manager,
chromeos::file_system_provider::Service* file_system_provider_service,
+ chromeos::file_system_provider::PluginService*
+ file_system_plugin_provided_service,
GetMtpStorageInfoCallback get_mtp_storage_info_callback)
: profile_(profile),
drive_integration_service_(drive_integration_service),
disk_mount_manager_(disk_mount_manager),
file_system_provider_service_(file_system_provider_service),
+ file_system_plugin_provided_service_(file_system_plugin_provided_service),
get_mtp_storage_info_callback_(get_mtp_storage_info_callback),
snapshot_manager_(new SnapshotManager(profile_)),
weak_ptr_factory_(this) {
@@ -347,7 +353,9 @@ void VolumeManager::Initialize() {
DoMountEvent(chromeos::MOUNT_ERROR_NONE, volume);
}
}
-
+ // Subscribe to PluginService
+ if (file_system_plugin_provided_service_)
+ file_system_plugin_provided_service_->AddObserver(this);
// Subscribe to Profile Preference change.
pref_change_registrar_.Init(profile_->GetPrefs());
pref_change_registrar_.Add(
@@ -377,6 +385,8 @@ void VolumeManager::Shutdown() {
if (file_system_provider_service_)
file_system_provider_service_->RemoveObserver(this);
+ if (file_system_plugin_provided_service_)
+ file_system_plugin_provided_service_->RemoveObserver(this);
}
void VolumeManager::AddObserver(VolumeManagerObserver* observer) {
« no previous file with comments | « chrome/browser/chromeos/file_manager/volume_manager.h ('k') | chrome/browser/chromeos/file_manager/volume_manager_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698