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