Chromium Code Reviews| 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 ab8f81508e32904a48ae11ebc96b58bb7709956f..6bb1cdfdd2e680ed0df93a9fceb8c94492eb4693 100644 |
| --- a/chrome/browser/chromeos/file_manager/volume_manager.cc |
| +++ b/chrome/browser/chromeos/file_manager/volume_manager.cc |
| @@ -494,9 +494,10 @@ void VolumeManager::OnDiskEvent( |
| // Initiate disk mount operation. MountPath auto-detects the filesystem |
| // format if the second argument is empty. The third argument (mount |
| // label) is not used in a disk mount operation. |
| + |
|
fukino
2016/08/03 07:18:19
nit: unintentional blank line?
yamaguchi
2016/08/03 10:22:14
Done.
|
| disk_mount_manager_->MountPath( |
| disk->device_path(), std::string(), std::string(), |
| - chromeos::MOUNT_TYPE_DEVICE); |
| + chromeos::MOUNT_TYPE_DEVICE, GetExternalStorageAccessMode()); |
| mounting = true; |
| } |
| @@ -611,7 +612,7 @@ void VolumeManager::OnFormatEvent( |
| // operation. |
| disk_mount_manager_->MountPath( |
| device_path, std::string(), std::string(), |
| - chromeos::MOUNT_TYPE_DEVICE); |
| + chromeos::MOUNT_TYPE_DEVICE, GetExternalStorageAccessMode()); |
| } |
| FOR_EACH_OBSERVER( |
| @@ -881,4 +882,11 @@ void VolumeManager::DoUnmountEvent(chromeos::MountError error_code, |
| OnVolumeUnmounted(error_code, *volume.get())); |
| } |
| +chromeos::MountAccessMode VolumeManager::GetExternalStorageAccessMode() { |
|
fukino
2016/08/03 07:18:19
This function can be defined under unnamed namespa
yamaguchi
2016/08/03 10:22:14
Done.
|
| + bool read_only = |
| + profile_->GetPrefs()->GetBoolean(prefs::kExternalStorageReadOnly); |
| + return read_only ? chromeos::MOUNT_ACCESS_MODE_READ_ONLY |
| + : chromeos::MOUNT_ACCESS_MODE_READ_WRITE; |
| +} |
| + |
| } // namespace file_manager |