| 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 return volume; | 207 return volume; |
| 208 } | 208 } |
| 209 | 209 |
| 210 // static | 210 // static |
| 211 Volume* Volume::CreateForProvidedFileSystem( | 211 Volume* Volume::CreateForProvidedFileSystem( |
| 212 const chromeos::file_system_provider::ProvidedFileSystemInfo& | 212 const chromeos::file_system_provider::ProvidedFileSystemInfo& |
| 213 file_system_info, | 213 file_system_info, |
| 214 MountContext mount_context) { | 214 MountContext mount_context) { |
| 215 Volume* const volume = new Volume; | 215 Volume* const volume = new Volume; |
| 216 volume->file_system_id_ = file_system_info.file_system_id(); | 216 volume->file_system_id_ = file_system_info.file_system_id(); |
| 217 volume->extension_id_ = file_system_info.extension_id(); | 217 // TODO(sabin): should change this |
| 218 volume->extension_id_ = file_system_info.source_id(); |
| 218 switch (file_system_info.source()) { | 219 switch (file_system_info.source()) { |
| 219 case chromeos::file_system_provider::SOURCE_UNKNOWN: | 220 case chromeos::file_system_provider::SOURCE_UNKNOWN: |
| 220 volume->volume_source_ = VOLUME_SOURCE_UNKNOWN; | 221 volume->volume_source_ = VOLUME_SOURCE_UNKNOWN; |
| 221 break; | 222 break; |
| 222 case chromeos::file_system_provider::SOURCE_FILE: | 223 case chromeos::file_system_provider::SOURCE_FILE: |
| 223 volume->volume_source_ = VOLUME_SOURCE_FILE; | 224 volume->volume_source_ = VOLUME_SOURCE_FILE; |
| 224 break; | 225 break; |
| 225 case chromeos::file_system_provider::SOURCE_DEVICE: | 226 case chromeos::file_system_provider::SOURCE_DEVICE: |
| 226 volume->volume_source_ = VOLUME_SOURCE_DEVICE; | 227 volume->volume_source_ = VOLUME_SOURCE_DEVICE; |
| 227 break; | 228 break; |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 if (mounted_volumes_.find(volume->volume_id()) == mounted_volumes_.end()) | 848 if (mounted_volumes_.find(volume->volume_id()) == mounted_volumes_.end()) |
| 848 return; | 849 return; |
| 849 if (error_code == chromeos::MOUNT_ERROR_NONE) | 850 if (error_code == chromeos::MOUNT_ERROR_NONE) |
| 850 mounted_volumes_.erase(volume->volume_id()); | 851 mounted_volumes_.erase(volume->volume_id()); |
| 851 | 852 |
| 852 FOR_EACH_OBSERVER(VolumeManagerObserver, observers_, | 853 FOR_EACH_OBSERVER(VolumeManagerObserver, observers_, |
| 853 OnVolumeUnmounted(error_code, *volume.get())); | 854 OnVolumeUnmounted(error_code, *volume.get())); |
| 854 } | 855 } |
| 855 | 856 |
| 856 } // namespace file_manager | 857 } // namespace file_manager |
| OLD | NEW |