| 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/extensions/file_manager/private_api_mount.h" | 5 #include "chrome/browser/chromeos/extensions/file_manager/private_api_mount.h" |
| 6 | 6 |
| 7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
| 8 #include "chrome/browser/chromeos/drive/file_system_interface.h" | 8 #include "chrome/browser/chromeos/drive/file_system_interface.h" |
| 9 #include "chrome/browser/chromeos/drive/file_system_util.h" | 9 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| 10 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" | 10 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 volume_info.mount_path.value(), | 121 volume_info.mount_path.value(), |
| 122 chromeos::UNMOUNT_OPTIONS_NONE, | 122 chromeos::UNMOUNT_OPTIONS_NONE, |
| 123 DiskMountManager::UnmountPathCallback()); | 123 DiskMountManager::UnmountPathCallback()); |
| 124 break; | 124 break; |
| 125 } | 125 } |
| 126 case file_manager::VOLUME_TYPE_PROVIDED: { | 126 case file_manager::VOLUME_TYPE_PROVIDED: { |
| 127 chromeos::file_system_provider::Service* service = | 127 chromeos::file_system_provider::Service* service = |
| 128 chromeos::file_system_provider::Service::Get(GetProfile()); | 128 chromeos::file_system_provider::Service::Get(GetProfile()); |
| 129 DCHECK(service); | 129 DCHECK(service); |
| 130 // TODO(mtomasz): Pass a more detailed error than just a bool. | 130 // TODO(mtomasz): Pass a more detailed error than just a bool. |
| 131 if (!service->RequestUnmount(volume_info.file_system_id)) | 131 if (!service->RequestUnmount(extension_->id(), |
| 132 volume_info.file_system_id)) { |
| 132 return false; | 133 return false; |
| 134 } |
| 133 break; | 135 break; |
| 134 } | 136 } |
| 135 default: | 137 default: |
| 136 // Requested unmounting a device which is not unmountable. | 138 // Requested unmounting a device which is not unmountable. |
| 137 return false; | 139 return false; |
| 138 } | 140 } |
| 139 | 141 |
| 140 SendResponse(true); | 142 SendResponse(true); |
| 141 return true; | 143 return true; |
| 142 } | 144 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 169 result.size()); | 171 result.size()); |
| 170 } | 172 } |
| 171 | 173 |
| 172 results_ = | 174 results_ = |
| 173 file_browser_private::GetVolumeMetadataList::Results::Create(result); | 175 file_browser_private::GetVolumeMetadataList::Results::Create(result); |
| 174 SendResponse(true); | 176 SendResponse(true); |
| 175 return true; | 177 return true; |
| 176 } | 178 } |
| 177 | 179 |
| 178 } // namespace extensions | 180 } // namespace extensions |
| OLD | NEW |