OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_browser_private_api.h" | 5 #include "chrome/browser/chromeos/extensions/file_browser_private_api.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 chromeos::MountType mount_type = | 1080 chromeos::MountType mount_type = |
1081 DiskMountManager::MountTypeFromString(mount_type_str); | 1081 DiskMountManager::MountTypeFromString(mount_type_str); |
1082 switch (mount_type) { | 1082 switch (mount_type) { |
1083 case chromeos::MOUNT_TYPE_INVALID: { | 1083 case chromeos::MOUNT_TYPE_INVALID: { |
1084 error_ = "Invalid mount type"; | 1084 error_ = "Invalid mount type"; |
1085 SendResponse(false); | 1085 SendResponse(false); |
1086 break; | 1086 break; |
1087 } | 1087 } |
1088 case chromeos::MOUNT_TYPE_GDATA: { | 1088 case chromeos::MOUNT_TYPE_GDATA: { |
1089 const bool success = true; | 1089 const bool success = true; |
| 1090 // Pass back the gdata mount point path as source path. |
| 1091 const std::string& gdata_path = |
| 1092 gdata::util::GetGDataMountPointPathAsString(); |
| 1093 SetResult(Value::CreateStringValue(gdata_path)); |
1090 FileBrowserEventRouterFactory::GetForProfile(profile_)-> | 1094 FileBrowserEventRouterFactory::GetForProfile(profile_)-> |
1091 MountDrive(base::Bind(&AddMountFunction::SendResponse, | 1095 MountDrive(base::Bind(&AddMountFunction::SendResponse, |
1092 this, | 1096 this, |
1093 success)); | 1097 success)); |
1094 break; | 1098 break; |
1095 } | 1099 } |
1096 default: { | 1100 default: { |
1097 UrlList file_paths; | 1101 UrlList file_paths; |
1098 file_paths.push_back(GURL(file_url)); | 1102 file_paths.push_back(GURL(file_url)); |
1099 | 1103 |
(...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2427 gdata::GDataSystemService* system_service = | 2431 gdata::GDataSystemService* system_service = |
2428 gdata::GDataSystemServiceFactory::GetForProfile(profile_); | 2432 gdata::GDataSystemServiceFactory::GetForProfile(profile_); |
2429 if (!system_service || !system_service->file_system()) | 2433 if (!system_service || !system_service->file_system()) |
2430 return false; | 2434 return false; |
2431 | 2435 |
2432 FilePath directory_path = GetVirtualPathFromURL(GURL(file_url_as_string)); | 2436 FilePath directory_path = GetVirtualPathFromURL(GURL(file_url_as_string)); |
2433 system_service->file_system()->RequestDirectoryRefresh(directory_path); | 2437 system_service->file_system()->RequestDirectoryRefresh(directory_path); |
2434 | 2438 |
2435 return true; | 2439 return true; |
2436 } | 2440 } |
OLD | NEW |