| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 156 |
| 157 // Pass back the actual source path of the mount point. | 157 // Pass back the actual source path of the mount point. |
| 158 SetResult(base::MakeUnique<base::StringValue>(file_path.AsUTF8Unsafe())); | 158 SetResult(base::MakeUnique<base::StringValue>(file_path.AsUTF8Unsafe())); |
| 159 SendResponse(true); | 159 SendResponse(true); |
| 160 | 160 |
| 161 // MountPath() takes a std::string. | 161 // MountPath() takes a std::string. |
| 162 DiskMountManager* disk_mount_manager = DiskMountManager::GetInstance(); | 162 DiskMountManager* disk_mount_manager = DiskMountManager::GetInstance(); |
| 163 disk_mount_manager->MountPath( | 163 disk_mount_manager->MountPath( |
| 164 file_path.AsUTF8Unsafe(), | 164 file_path.AsUTF8Unsafe(), |
| 165 base::FilePath(display_name.Extension()).AsUTF8Unsafe(), | 165 base::FilePath(display_name.Extension()).AsUTF8Unsafe(), |
| 166 display_name.AsUTF8Unsafe(), | 166 display_name.AsUTF8Unsafe(), chromeos::MOUNT_TYPE_ARCHIVE, |
| 167 chromeos::MOUNT_TYPE_ARCHIVE); | 167 chromeos::MOUNT_ACCESS_MODE_READ_WRITE); |
| 168 } | 168 } |
| 169 | 169 |
| 170 bool FileManagerPrivateRemoveMountFunction::RunAsync() { | 170 bool FileManagerPrivateRemoveMountFunction::RunAsync() { |
| 171 using file_manager_private::RemoveMount::Params; | 171 using file_manager_private::RemoveMount::Params; |
| 172 const std::unique_ptr<Params> params(Params::Create(*args_)); | 172 const std::unique_ptr<Params> params(Params::Create(*args_)); |
| 173 EXTENSION_FUNCTION_VALIDATE(params); | 173 EXTENSION_FUNCTION_VALIDATE(params); |
| 174 | 174 |
| 175 drive::EventLogger* logger = file_manager::util::GetLogger(GetProfile()); | 175 drive::EventLogger* logger = file_manager::util::GetLogger(GetProfile()); |
| 176 if (logger) { | 176 if (logger) { |
| 177 logger->Log(logging::LOG_INFO, "%s[%d] called. (volume_id: '%s')", name(), | 177 logger->Log(logging::LOG_INFO, "%s[%d] called. (volume_id: '%s')", name(), |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 name(), request_id(), log_string.c_str(), result.size()); | 246 name(), request_id(), log_string.c_str(), result.size()); |
| 247 } | 247 } |
| 248 | 248 |
| 249 results_ = | 249 results_ = |
| 250 file_manager_private::GetVolumeMetadataList::Results::Create(result); | 250 file_manager_private::GetVolumeMetadataList::Results::Create(result); |
| 251 SendResponse(true); | 251 SendResponse(true); |
| 252 return true; | 252 return true; |
| 253 } | 253 } |
| 254 | 254 |
| 255 } // namespace extensions | 255 } // namespace extensions |
| OLD | NEW |