OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/file_manager/volume_manager.h" | 5 #include "chrome/browser/chromeos/file_manager/volume_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 storage_monitor::StorageMonitor::GetInstance()->EnsureInitialized( | 404 storage_monitor::StorageMonitor::GetInstance()->EnsureInitialized( |
405 base::Bind(&VolumeManager::OnStorageMonitorInitialized, | 405 base::Bind(&VolumeManager::OnStorageMonitorInitialized, |
406 weak_ptr_factory_.GetWeakPtr())); | 406 weak_ptr_factory_.GetWeakPtr())); |
407 } | 407 } |
408 | 408 |
409 // Subscribe to ARC file system events. | 409 // Subscribe to ARC file system events. |
410 if (base::FeatureList::IsEnabled(arc::kMediaViewFeature) && | 410 if (base::FeatureList::IsEnabled(arc::kMediaViewFeature) && |
411 arc::IsArcAllowedForProfile(profile_)) { | 411 arc::IsArcAllowedForProfile(profile_)) { |
412 arc::ArcSessionManager::Get()->AddObserver(this); | 412 arc::ArcSessionManager::Get()->AddObserver(this); |
413 OnArcPlayStoreEnabledChanged( | 413 OnArcPlayStoreEnabledChanged( |
414 arc::ArcSessionManager::Get()->IsArcPlayStoreEnabled()); | 414 arc::IsArcPlayStoreEnabledForProfile(profile_)); |
415 } | 415 } |
416 } | 416 } |
417 | 417 |
418 void VolumeManager::Shutdown() { | 418 void VolumeManager::Shutdown() { |
419 weak_ptr_factory_.InvalidateWeakPtrs(); | 419 weak_ptr_factory_.InvalidateWeakPtrs(); |
420 | 420 |
421 snapshot_manager_.reset(); | 421 snapshot_manager_.reset(); |
422 pref_change_registrar_.RemoveAll(); | 422 pref_change_registrar_.RemoveAll(); |
423 disk_mount_manager_->RemoveObserver(this); | 423 disk_mount_manager_->RemoveObserver(this); |
424 if (storage_monitor::StorageMonitor::GetInstance()) | 424 if (storage_monitor::StorageMonitor::GetInstance()) |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 if (mounted_volumes_.find(volume->volume_id()) == mounted_volumes_.end()) | 987 if (mounted_volumes_.find(volume->volume_id()) == mounted_volumes_.end()) |
988 return; | 988 return; |
989 if (error_code == chromeos::MOUNT_ERROR_NONE) | 989 if (error_code == chromeos::MOUNT_ERROR_NONE) |
990 mounted_volumes_.erase(volume->volume_id()); | 990 mounted_volumes_.erase(volume->volume_id()); |
991 | 991 |
992 for (auto& observer : observers_) | 992 for (auto& observer : observers_) |
993 observer.OnVolumeUnmounted(error_code, *volume.get()); | 993 observer.OnVolumeUnmounted(error_code, *volume.get()); |
994 } | 994 } |
995 | 995 |
996 } // namespace file_manager | 996 } // namespace file_manager |
OLD | NEW |