| 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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 chromeos::UNMOUNT_OPTIONS_LAZY, | 502 chromeos::UNMOUNT_OPTIONS_LAZY, |
| 503 chromeos::disks::DiskMountManager::UnmountPathCallback()); | 503 chromeos::disks::DiskMountManager::UnmountPathCallback()); |
| 504 } | 504 } |
| 505 | 505 |
| 506 // Notify to observers. | 506 // Notify to observers. |
| 507 FOR_EACH_OBSERVER(VolumeManagerObserver, observers_, | 507 FOR_EACH_OBSERVER(VolumeManagerObserver, observers_, |
| 508 OnDiskRemoved(*disk)); | 508 OnDiskRemoved(*disk)); |
| 509 const std::string& device_path = disk->system_path_prefix(); | 509 const std::string& device_path = disk->system_path_prefix(); |
| 510 if (mounted_disk_monitor_->DeviceIsHardUnpluggedButNotReported( | 510 if (mounted_disk_monitor_->DeviceIsHardUnpluggedButNotReported( |
| 511 device_path)) { | 511 device_path)) { |
| 512 FOR_EACH_OBSERVER(VolumeManagerObserver, observers_, | |
| 513 OnHardUnplugged(device_path)); | |
| 514 mounted_disk_monitor_->MarkAsHardUnpluggedReported(device_path); | 512 mounted_disk_monitor_->MarkAsHardUnpluggedReported(device_path); |
| 515 } | 513 } |
| 516 return; | 514 return; |
| 517 } | 515 } |
| 518 NOTREACHED(); | 516 NOTREACHED(); |
| 519 } | 517 } |
| 520 | 518 |
| 521 void VolumeManager::OnDeviceEvent( | 519 void VolumeManager::OnDeviceEvent( |
| 522 chromeos::disks::DiskMountManager::DeviceEvent event, | 520 chromeos::disks::DiskMountManager::DeviceEvent event, |
| 523 const std::string& device_path) { | 521 const std::string& device_path) { |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 return; | 853 return; |
| 856 if (error_code == chromeos::MOUNT_ERROR_NONE) | 854 if (error_code == chromeos::MOUNT_ERROR_NONE) |
| 857 mounted_volumes_.erase(volume_info.volume_id); | 855 mounted_volumes_.erase(volume_info.volume_id); |
| 858 | 856 |
| 859 FOR_EACH_OBSERVER(VolumeManagerObserver, | 857 FOR_EACH_OBSERVER(VolumeManagerObserver, |
| 860 observers_, | 858 observers_, |
| 861 OnVolumeUnmounted(error_code, volume_info)); | 859 OnVolumeUnmounted(error_code, volume_info)); |
| 862 } | 860 } |
| 863 | 861 |
| 864 } // namespace file_manager | 862 } // namespace file_manager |
| OLD | NEW |