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

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

Issue 2401963002: Remount all removable storage devices upon policy update (Closed)
Patch Set: User ASSERT_EQ to avoid test crash. Created 4 years, 1 month 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 facd03ca5e2cfc2ce790ac612eede5fbd8cea9e8..4464bb60c0cb9c27c5c8e5bd8ed3986cf3e1eee1 100644
--- a/chrome/browser/chromeos/file_manager/volume_manager.cc
+++ b/chrome/browser/chromeos/file_manager/volume_manager.cc
@@ -371,6 +371,10 @@ void VolumeManager::Initialize() {
prefs::kExternalStorageDisabled,
base::Bind(&VolumeManager::OnExternalStorageDisabledChanged,
weak_ptr_factory_.GetWeakPtr()));
+ pref_change_registrar_.Add(
+ prefs::kExternalStorageReadOnly,
+ base::Bind(&VolumeManager::OnExternalStorageReadOnlyChanged,
+ weak_ptr_factory_.GetWeakPtr()));
// Subscribe to storage monitor for MTP notifications.
if (storage_monitor::StorageMonitor::GetInstance()) {
@@ -718,6 +722,11 @@ void VolumeManager::OnExternalStorageDisabledChanged() {
}
}
+void VolumeManager::OnExternalStorageReadOnlyChanged() {
+ disk_mount_manager_->RemountAllRemovableDrives(
+ GetExternalStorageAccessMode(profile_));
+}
+
void VolumeManager::OnRemovableStorageAttached(
const storage_monitor::StorageInfo& info) {
if (!storage_monitor::StorageInfo::IsMTPDevice(info.device_id()))
« no previous file with comments | « chrome/browser/chromeos/file_manager/volume_manager.h ('k') | chrome/browser/chromeos/file_manager/volume_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698