| 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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 volume_info.source_path = base::FilePath(mount_point.source_path); | 172 volume_info.source_path = base::FilePath(mount_point.source_path); |
| 173 volume_info.mount_path = base::FilePath(mount_point.mount_path); | 173 volume_info.mount_path = base::FilePath(mount_point.mount_path); |
| 174 volume_info.mount_condition = mount_point.mount_condition; | 174 volume_info.mount_condition = mount_point.mount_condition; |
| 175 volume_info.volume_label = volume_info.mount_path.BaseName().AsUTF8Unsafe(); | 175 volume_info.volume_label = volume_info.mount_path.BaseName().AsUTF8Unsafe(); |
| 176 if (disk) { | 176 if (disk) { |
| 177 volume_info.device_type = disk->device_type(); | 177 volume_info.device_type = disk->device_type(); |
| 178 volume_info.system_path_prefix = | 178 volume_info.system_path_prefix = |
| 179 base::FilePath(disk->system_path_prefix()); | 179 base::FilePath(disk->system_path_prefix()); |
| 180 volume_info.is_parent = disk->is_parent(); | 180 volume_info.is_parent = disk->is_parent(); |
| 181 volume_info.is_read_only = disk->is_read_only(); | 181 volume_info.is_read_only = disk->is_read_only(); |
| 182 volume_info.has_media = disk->has_media(); |
| 182 } else { | 183 } else { |
| 183 volume_info.device_type = chromeos::DEVICE_TYPE_UNKNOWN; | 184 volume_info.device_type = chromeos::DEVICE_TYPE_UNKNOWN; |
| 184 volume_info.is_parent = false; | 185 volume_info.is_parent = false; |
| 185 volume_info.is_read_only = | 186 volume_info.is_read_only = |
| 186 (mount_point.mount_type == chromeos::MOUNT_TYPE_ARCHIVE); | 187 (mount_point.mount_type == chromeos::MOUNT_TYPE_ARCHIVE); |
| 188 volume_info.has_media = false; |
| 187 } | 189 } |
| 188 volume_info.volume_id = GenerateVolumeId(volume_info); | 190 volume_info.volume_id = GenerateVolumeId(volume_info); |
| 189 | 191 |
| 190 return volume_info; | 192 return volume_info; |
| 191 } | 193 } |
| 192 | 194 |
| 193 VolumeInfo CreateProvidedFileSystemVolumeInfo( | 195 VolumeInfo CreateProvidedFileSystemVolumeInfo( |
| 194 const chromeos::file_system_provider::ProvidedFileSystemInfo& | 196 const chromeos::file_system_provider::ProvidedFileSystemInfo& |
| 195 file_system_info) { | 197 file_system_info) { |
| 196 VolumeInfo volume_info; | 198 VolumeInfo volume_info; |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 return; | 793 return; |
| 792 if (error_code == chromeos::MOUNT_ERROR_NONE) | 794 if (error_code == chromeos::MOUNT_ERROR_NONE) |
| 793 mounted_volumes_.erase(volume_info.volume_id); | 795 mounted_volumes_.erase(volume_info.volume_id); |
| 794 | 796 |
| 795 FOR_EACH_OBSERVER(VolumeManagerObserver, | 797 FOR_EACH_OBSERVER(VolumeManagerObserver, |
| 796 observers_, | 798 observers_, |
| 797 OnVolumeUnmounted(error_code, volume_info)); | 799 OnVolumeUnmounted(error_code, volume_info)); |
| 798 } | 800 } |
| 799 | 801 |
| 800 } // namespace file_manager | 802 } // namespace file_manager |
| OLD | NEW |