Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1474)

Unified Diff: chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc

Issue 23581006: Reland 220012: Move the functions of filebrowserPrivateApi from the file_manager namespace to the e… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc
diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc
index 778f10ff572c3865b3f86d49b4304a8335253c6d..59e315e964b9297496ae6487ef3826c0a52d8a3d 100644
--- a/chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc
@@ -22,7 +22,7 @@
using content::BrowserThread;
-namespace file_manager {
+namespace extensions {
namespace {
// List of connection types of drive.
@@ -80,7 +80,8 @@ bool GetDriveEntryPropertiesFunction::RunImpl() {
GURL file_url = GURL(file_url_str);
file_path_ = drive::util::ExtractDrivePath(
- util::GetLocalPathFromURL(render_view_host(), profile(), file_url));
+ file_manager::util::GetLocalPathFromURL(
+ render_view_host(), profile(), file_url));
properties_.reset(new base::DictionaryValue);
properties_->SetString("fileUrl", file_url.spec());
@@ -137,12 +138,13 @@ void GetDriveEntryPropertiesFunction::OnGetFileInfo(
integration_service->drive_app_registry()->GetAppsForFile(
file_path_, file_specific_info.content_mime_type(), &drive_apps);
if (!drive_apps.empty()) {
- std::string default_task_id = file_tasks::GetDefaultTaskIdFromPrefs(
- *profile_->GetPrefs(),
- file_specific_info.content_mime_type(),
- file_path_.Extension());
- file_tasks::TaskDescriptor default_task;
- file_tasks::ParseTaskID(default_task_id, &default_task);
+ std::string default_task_id =
+ file_manager::file_tasks::GetDefaultTaskIdFromPrefs(
+ *profile_->GetPrefs(),
+ file_specific_info.content_mime_type(),
+ file_path_.Extension());
+ file_manager::file_tasks::TaskDescriptor default_task;
+ file_manager::file_tasks::ParseTaskID(default_task_id, &default_task);
DCHECK(default_task_id.empty() || !default_task.app_id.empty());
for (size_t i = 0; i < drive_apps.size(); ++i) {
const drive::DriveAppInfo* app_info = drive_apps[i];
@@ -204,8 +206,8 @@ bool PinDriveFileFunction::RunImpl() {
return false;
base::FilePath drive_path =
- drive::util::ExtractDrivePath(
- util::GetLocalPathFromURL(render_view_host(), profile(), GURL(url)));
+ drive::util::ExtractDrivePath(file_manager::util::GetLocalPathFromURL(
+ render_view_host(), profile(), GURL(url)));
if (set_pin) {
file_system->Pin(drive_path,
base::Bind(&PinDriveFileFunction::OnPinStateSet, this));
@@ -244,7 +246,7 @@ bool GetDriveFilesFunction::RunImpl() {
std::string file_url_as_string;
if (!file_urls_as_strings->GetString(i, &file_url_as_string))
return false;
- const base::FilePath path = util::GetLocalPathFromURL(
+ const base::FilePath path = file_manager::util::GetLocalPathFromURL(
render_view_host(), profile(), GURL(file_url_as_string));
DCHECK(drive::util::IsUnderDriveMountPoint(path));
base::FilePath drive_path = drive::util::ExtractDrivePath(path);
@@ -344,7 +346,7 @@ bool CancelFileTransfersFunction::RunImpl() {
std::string url_as_string;
url_list->GetString(i, &url_as_string);
- base::FilePath file_path = util::GetLocalPathFromURL(
+ base::FilePath file_path = file_manager::util::GetLocalPathFromURL(
render_view_host(), profile(), GURL(url_as_string));
if (file_path.empty())
continue;
@@ -650,7 +652,7 @@ bool GetShareUrlFunction::RunImpl() {
if (!args_->GetString(0, &file_url))
return false;
- const base::FilePath path = util::GetLocalPathFromURL(
+ const base::FilePath path = file_manager::util::GetLocalPathFromURL(
render_view_host(), profile(), GURL(file_url));
DCHECK(drive::util::IsUnderDriveMountPoint(path));
@@ -664,7 +666,7 @@ bool GetShareUrlFunction::RunImpl() {
integration_service->file_system()->GetShareUrl(
drive_path,
- util::GetFileManagerBaseUrl(), // embed origin
+ file_manager::util::GetFileManagerBaseUrl(), // embed origin
base::Bind(&GetShareUrlFunction::OnGetShareUrl, this));
return true;
}
@@ -682,4 +684,4 @@ void GetShareUrlFunction::OnGetShareUrl(drive::FileError error,
SendResponse(true);
}
-} // namespace file_manager
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698