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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 drive::FileError error, | 148 drive::FileError error, |
149 const base::FilePath& file_path) { | 149 const base::FilePath& file_path) { |
150 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 150 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
151 | 151 |
152 if (error != drive::FILE_ERROR_OK) { | 152 if (error != drive::FILE_ERROR_OK) { |
153 SendResponse(false); | 153 SendResponse(false); |
154 return; | 154 return; |
155 } | 155 } |
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::Value>(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(), chromeos::MOUNT_TYPE_ARCHIVE, | 166 display_name.AsUTF8Unsafe(), chromeos::MOUNT_TYPE_ARCHIVE, |
167 chromeos::MOUNT_ACCESS_MODE_READ_WRITE); | 167 chromeos::MOUNT_ACCESS_MODE_READ_WRITE); |
168 } | 168 } |
(...skipping 77 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 |