| 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 #ifndef CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 class PowerManagerClient; | 31 class PowerManagerClient; |
| 32 } // namespace chromeos | 32 } // namespace chromeos |
| 33 | 33 |
| 34 namespace content { | 34 namespace content { |
| 35 class BrowserContext; | 35 class BrowserContext; |
| 36 } // namespace content | 36 } // namespace content |
| 37 | 37 |
| 38 namespace file_manager { | 38 namespace file_manager { |
| 39 | 39 |
| 40 class MountedDiskMonitor; | 40 class MountedDiskMonitor; |
| 41 class SnapshotManager; |
| 41 class VolumeManagerObserver; | 42 class VolumeManagerObserver; |
| 42 | 43 |
| 43 // Identifiers for volume types managed by Chrome OS file manager. | 44 // Identifiers for volume types managed by Chrome OS file manager. |
| 44 enum VolumeType { | 45 enum VolumeType { |
| 45 VOLUME_TYPE_TESTING = -1, // Used only in tests. | 46 VOLUME_TYPE_TESTING = -1, // Used only in tests. |
| 46 VOLUME_TYPE_GOOGLE_DRIVE = 0, | 47 VOLUME_TYPE_GOOGLE_DRIVE = 0, |
| 47 VOLUME_TYPE_DOWNLOADS_DIRECTORY, | 48 VOLUME_TYPE_DOWNLOADS_DIRECTORY, |
| 48 VOLUME_TYPE_REMOVABLE_DISK_PARTITION, | 49 VOLUME_TYPE_REMOVABLE_DISK_PARTITION, |
| 49 VOLUME_TYPE_MOUNTED_ARCHIVE_FILE, | 50 VOLUME_TYPE_MOUNTED_ARCHIVE_FILE, |
| 50 VOLUME_TYPE_CLOUD_DEVICE, | 51 VOLUME_TYPE_CLOUD_DEVICE, |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 | 196 |
| 196 // Called on change to kExternalStorageDisabled pref. | 197 // Called on change to kExternalStorageDisabled pref. |
| 197 void OnExternalStorageDisabledChanged(); | 198 void OnExternalStorageDisabledChanged(); |
| 198 | 199 |
| 199 // RemovableStorageObserver overrides. | 200 // RemovableStorageObserver overrides. |
| 200 virtual void OnRemovableStorageAttached( | 201 virtual void OnRemovableStorageAttached( |
| 201 const storage_monitor::StorageInfo& info) OVERRIDE; | 202 const storage_monitor::StorageInfo& info) OVERRIDE; |
| 202 virtual void OnRemovableStorageDetached( | 203 virtual void OnRemovableStorageDetached( |
| 203 const storage_monitor::StorageInfo& info) OVERRIDE; | 204 const storage_monitor::StorageInfo& info) OVERRIDE; |
| 204 | 205 |
| 206 SnapshotManager* snapshot_manager() { return snapshot_manager_.get(); } |
| 207 |
| 205 private: | 208 private: |
| 206 void OnStorageMonitorInitialized(); | 209 void OnStorageMonitorInitialized(); |
| 207 void OnPrivetVolumesAvailable( | 210 void OnPrivetVolumesAvailable( |
| 208 const local_discovery::PrivetVolumeLister::VolumeList& volumes); | 211 const local_discovery::PrivetVolumeLister::VolumeList& volumes); |
| 209 void DoMountEvent(chromeos::MountError error_code, | 212 void DoMountEvent(chromeos::MountError error_code, |
| 210 const VolumeInfo& volume_info, | 213 const VolumeInfo& volume_info, |
| 211 bool is_remounting); | 214 bool is_remounting); |
| 212 void DoUnmountEvent(chromeos::MountError error_code, | 215 void DoUnmountEvent(chromeos::MountError error_code, |
| 213 const VolumeInfo& volume_info); | 216 const VolumeInfo& volume_info); |
| 214 | 217 |
| 215 Profile* profile_; | 218 Profile* profile_; |
| 216 drive::DriveIntegrationService* drive_integration_service_; // Not owned. | 219 drive::DriveIntegrationService* drive_integration_service_; // Not owned. |
| 217 chromeos::disks::DiskMountManager* disk_mount_manager_; // Not owned. | 220 chromeos::disks::DiskMountManager* disk_mount_manager_; // Not owned. |
| 218 scoped_ptr<MountedDiskMonitor> mounted_disk_monitor_; | 221 scoped_ptr<MountedDiskMonitor> mounted_disk_monitor_; |
| 219 PrefChangeRegistrar pref_change_registrar_; | 222 PrefChangeRegistrar pref_change_registrar_; |
| 220 ObserverList<VolumeManagerObserver> observers_; | 223 ObserverList<VolumeManagerObserver> observers_; |
| 221 scoped_ptr<local_discovery::PrivetVolumeLister> privet_volume_lister_; | 224 scoped_ptr<local_discovery::PrivetVolumeLister> privet_volume_lister_; |
| 222 chromeos::file_system_provider::Service* | 225 chromeos::file_system_provider::Service* |
| 223 file_system_provider_service_; // Not owned by this class. | 226 file_system_provider_service_; // Not owned by this class. |
| 224 std::map<std::string, VolumeInfo> mounted_volumes_; | 227 std::map<std::string, VolumeInfo> mounted_volumes_; |
| 228 scoped_ptr<SnapshotManager> snapshot_manager_; |
| 225 | 229 |
| 226 // Note: This should remain the last member so it'll be destroyed and | 230 // Note: This should remain the last member so it'll be destroyed and |
| 227 // invalidate its weak pointers before any other members are destroyed. | 231 // invalidate its weak pointers before any other members are destroyed. |
| 228 base::WeakPtrFactory<VolumeManager> weak_ptr_factory_; | 232 base::WeakPtrFactory<VolumeManager> weak_ptr_factory_; |
| 229 DISALLOW_COPY_AND_ASSIGN(VolumeManager); | 233 DISALLOW_COPY_AND_ASSIGN(VolumeManager); |
| 230 }; | 234 }; |
| 231 | 235 |
| 232 } // namespace file_manager | 236 } // namespace file_manager |
| 233 | 237 |
| 234 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_H_ | 238 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_H_ |
| OLD | NEW |