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(); | |
183 } else { | 182 } else { |
184 volume_info.device_type = chromeos::DEVICE_TYPE_UNKNOWN; | 183 volume_info.device_type = chromeos::DEVICE_TYPE_UNKNOWN; |
185 volume_info.is_parent = false; | 184 volume_info.is_parent = false; |
186 volume_info.is_read_only = | 185 volume_info.is_read_only = |
187 (mount_point.mount_type == chromeos::MOUNT_TYPE_ARCHIVE); | 186 (mount_point.mount_type == chromeos::MOUNT_TYPE_ARCHIVE); |
188 volume_info.has_media = false; | |
189 } | 187 } |
190 volume_info.volume_id = GenerateVolumeId(volume_info); | 188 volume_info.volume_id = GenerateVolumeId(volume_info); |
191 | 189 |
192 return volume_info; | 190 return volume_info; |
193 } | 191 } |
194 | 192 |
195 VolumeInfo CreateProvidedFileSystemVolumeInfo( | 193 VolumeInfo CreateProvidedFileSystemVolumeInfo( |
196 const chromeos::file_system_provider::ProvidedFileSystemInfo& | 194 const chromeos::file_system_provider::ProvidedFileSystemInfo& |
197 file_system_info) { | 195 file_system_info) { |
198 VolumeInfo volume_info; | 196 VolumeInfo volume_info; |
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 return; | 791 return; |
794 if (error_code == chromeos::MOUNT_ERROR_NONE) | 792 if (error_code == chromeos::MOUNT_ERROR_NONE) |
795 mounted_volumes_.erase(volume_info.volume_id); | 793 mounted_volumes_.erase(volume_info.volume_id); |
796 | 794 |
797 FOR_EACH_OBSERVER(VolumeManagerObserver, | 795 FOR_EACH_OBSERVER(VolumeManagerObserver, |
798 observers_, | 796 observers_, |
799 OnVolumeUnmounted(error_code, volume_info)); | 797 OnVolumeUnmounted(error_code, volume_info)); |
800 } | 798 } |
801 | 799 |
802 } // namespace file_manager | 800 } // namespace file_manager |
OLD | NEW |