| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/files/file.h" |
| 12 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 15 #include "base/prefs/pref_change_registrar.h" | 16 #include "base/prefs/pref_change_registrar.h" |
| 16 #include "chrome/browser/chromeos/drive/drive_integration_service.h" | 17 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
| 17 #include "chrome/browser/chromeos/file_system_provider/observer.h" | 18 #include "chrome/browser/chromeos/file_system_provider/observer.h" |
| 18 #include "chrome/browser/chromeos/file_system_provider/service.h" | 19 #include "chrome/browser/chromeos/file_system_provider/service.h" |
| 19 #include "chrome/browser/local_discovery/storage/privet_volume_lister.h" | 20 #include "chrome/browser/local_discovery/storage/privet_volume_lister.h" |
| 20 #include "chromeos/dbus/cros_disks_client.h" | 21 #include "chromeos/dbus/cros_disks_client.h" |
| 21 #include "chromeos/disks/disk_mount_manager.h" | 22 #include "chromeos/disks/disk_mount_manager.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 49 VOLUME_TYPE_MOUNTED_ARCHIVE_FILE, | 50 VOLUME_TYPE_MOUNTED_ARCHIVE_FILE, |
| 50 VOLUME_TYPE_CLOUD_DEVICE, | 51 VOLUME_TYPE_CLOUD_DEVICE, |
| 51 VOLUME_TYPE_PROVIDED, | 52 VOLUME_TYPE_PROVIDED, |
| 52 VOLUME_TYPE_TESTING | 53 VOLUME_TYPE_TESTING |
| 53 }; | 54 }; |
| 54 | 55 |
| 55 struct VolumeInfo { | 56 struct VolumeInfo { |
| 56 VolumeInfo(); | 57 VolumeInfo(); |
| 57 ~VolumeInfo(); | 58 ~VolumeInfo(); |
| 58 | 59 |
| 60 // The ID for provided file system. If other type, then undefined. |
| 61 int file_system_id; |
| 62 |
| 59 // The ID of the volume. | 63 // The ID of the volume. |
| 60 std::string volume_id; | 64 std::string volume_id; |
| 61 | 65 |
| 62 // The type of mounted volume. | 66 // The type of mounted volume. |
| 63 VolumeType type; | 67 VolumeType type; |
| 64 | 68 |
| 65 // The type of device. (e.g. USB, SD card, DVD etc.) | 69 // The type of device. (e.g. USB, SD card, DVD etc.) |
| 66 chromeos::DeviceType device_type; | 70 chromeos::DeviceType device_type; |
| 67 | 71 |
| 68 // The source path of the volume. | 72 // The source path of the volume. |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 chromeos::disks::DiskMountManager::MountEvent event, | 166 chromeos::disks::DiskMountManager::MountEvent event, |
| 163 chromeos::MountError error_code, | 167 chromeos::MountError error_code, |
| 164 const chromeos::disks::DiskMountManager::MountPointInfo& mount_info) | 168 const chromeos::disks::DiskMountManager::MountPointInfo& mount_info) |
| 165 OVERRIDE; | 169 OVERRIDE; |
| 166 virtual void OnFormatEvent( | 170 virtual void OnFormatEvent( |
| 167 chromeos::disks::DiskMountManager::FormatEvent event, | 171 chromeos::disks::DiskMountManager::FormatEvent event, |
| 168 chromeos::FormatError error_code, | 172 chromeos::FormatError error_code, |
| 169 const std::string& device_path) OVERRIDE; | 173 const std::string& device_path) OVERRIDE; |
| 170 | 174 |
| 171 // chromeos::file_system_provider::Observer overrides. | 175 // chromeos::file_system_provider::Observer overrides. |
| 172 virtual void OnProvidedFileSystemRegistered( | 176 virtual void OnProvidedFileSystemMount( |
| 173 const chromeos::file_system_provider::ProvidedFileSystem& file_system) | 177 const chromeos::file_system_provider::ProvidedFileSystem& file_system, |
| 174 OVERRIDE; | 178 base::File::Error error) OVERRIDE; |
| 175 virtual void OnProvidedFileSystemUnregistered( | 179 virtual void OnProvidedFileSystemUnmount( |
| 176 const chromeos::file_system_provider::ProvidedFileSystem& file_system) | 180 const chromeos::file_system_provider::ProvidedFileSystem& file_system, |
| 177 OVERRIDE; | 181 base::File::Error error) OVERRIDE; |
| 178 | 182 |
| 179 // Called on change to kExternalStorageDisabled pref. | 183 // Called on change to kExternalStorageDisabled pref. |
| 180 void OnExternalStorageDisabledChanged(); | 184 void OnExternalStorageDisabledChanged(); |
| 181 | 185 |
| 182 private: | 186 private: |
| 183 void OnPrivetVolumesAvailable( | 187 void OnPrivetVolumesAvailable( |
| 184 const local_discovery::PrivetVolumeLister::VolumeList& volumes); | 188 const local_discovery::PrivetVolumeLister::VolumeList& volumes); |
| 185 void DoMountEvent(chromeos::MountError error_code, | 189 void DoMountEvent(chromeos::MountError error_code, |
| 186 const VolumeInfo& volume_info, | 190 const VolumeInfo& volume_info, |
| 187 bool is_remounting); | 191 bool is_remounting); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 198 chromeos::file_system_provider::Service* file_system_provider_service_; | 202 chromeos::file_system_provider::Service* file_system_provider_service_; |
| 199 | 203 |
| 200 std::map<std::string, VolumeInfo> mounted_volumes_; | 204 std::map<std::string, VolumeInfo> mounted_volumes_; |
| 201 | 205 |
| 202 DISALLOW_COPY_AND_ASSIGN(VolumeManager); | 206 DISALLOW_COPY_AND_ASSIGN(VolumeManager); |
| 203 }; | 207 }; |
| 204 | 208 |
| 205 } // namespace file_manager | 209 } // namespace file_manager |
| 206 | 210 |
| 207 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_H_ | 211 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_H_ |
| OLD | NEW |