| 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/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 } | 176 } |
| 177 | 177 |
| 178 VolumeInfo CreateVolumeInfoFromMountPointInfo( | 178 VolumeInfo CreateVolumeInfoFromMountPointInfo( |
| 179 const chromeos::disks::DiskMountManager::MountPointInfo& mount_point, | 179 const chromeos::disks::DiskMountManager::MountPointInfo& mount_point, |
| 180 const chromeos::disks::DiskMountManager::Disk* disk) { | 180 const chromeos::disks::DiskMountManager::Disk* disk) { |
| 181 VolumeInfo volume_info; | 181 VolumeInfo volume_info; |
| 182 volume_info.type = MountTypeToVolumeType(mount_point.mount_type); | 182 volume_info.type = MountTypeToVolumeType(mount_point.mount_type); |
| 183 volume_info.source_path = base::FilePath(mount_point.source_path); | 183 volume_info.source_path = base::FilePath(mount_point.source_path); |
| 184 volume_info.mount_path = base::FilePath(mount_point.mount_path); | 184 volume_info.mount_path = base::FilePath(mount_point.mount_path); |
| 185 volume_info.mount_condition = mount_point.mount_condition; | 185 volume_info.mount_condition = mount_point.mount_condition; |
| 186 volume_info.volume_label = volume_info.mount_path.BaseName().AsUTF8Unsafe(); |
| 186 if (disk) { | 187 if (disk) { |
| 187 volume_info.device_type = disk->device_type(); | 188 volume_info.device_type = disk->device_type(); |
| 188 volume_info.system_path_prefix = | 189 volume_info.system_path_prefix = |
| 189 base::FilePath(disk->system_path_prefix()); | 190 base::FilePath(disk->system_path_prefix()); |
| 190 volume_info.volume_label = disk->drive_label(); | |
| 191 volume_info.is_parent = disk->is_parent(); | 191 volume_info.is_parent = disk->is_parent(); |
| 192 volume_info.is_read_only = disk->is_read_only(); | 192 volume_info.is_read_only = disk->is_read_only(); |
| 193 } else { | 193 } else { |
| 194 volume_info.device_type = chromeos::DEVICE_TYPE_UNKNOWN; | 194 volume_info.device_type = chromeos::DEVICE_TYPE_UNKNOWN; |
| 195 volume_info.is_parent = false; | 195 volume_info.is_parent = false; |
| 196 volume_info.is_read_only = | 196 volume_info.is_read_only = |
| 197 (mount_point.mount_type == chromeos::MOUNT_TYPE_ARCHIVE); | 197 (mount_point.mount_type == chromeos::MOUNT_TYPE_ARCHIVE); |
| 198 } | 198 } |
| 199 volume_info.volume_id = GenerateVolumeId(volume_info); | 199 volume_info.volume_id = GenerateVolumeId(volume_info); |
| 200 | 200 |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 return; | 836 return; |
| 837 if (error_code == chromeos::MOUNT_ERROR_NONE) | 837 if (error_code == chromeos::MOUNT_ERROR_NONE) |
| 838 mounted_volumes_.erase(volume_info.volume_id); | 838 mounted_volumes_.erase(volume_info.volume_id); |
| 839 | 839 |
| 840 FOR_EACH_OBSERVER(VolumeManagerObserver, | 840 FOR_EACH_OBSERVER(VolumeManagerObserver, |
| 841 observers_, | 841 observers_, |
| 842 OnVolumeUnmounted(error_code, volume_info)); | 842 OnVolumeUnmounted(error_code, volume_info)); |
| 843 } | 843 } |
| 844 | 844 |
| 845 } // namespace file_manager | 845 } // namespace file_manager |
| OLD | NEW |