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

Unified Diff: chrome/browser/google_apis/gdata_wapi_operations.cc

Issue 12039005: drive: Deal with the root directory in the same way as others in MoveOperation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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/google_apis/gdata_wapi_operations.cc
diff --git a/chrome/browser/google_apis/gdata_wapi_operations.cc b/chrome/browser/google_apis/gdata_wapi_operations.cc
index d4de9972b35ecbc73b53c078f8b7cce107238991..99a083d6f0a1b08483dc1d2fe2ae0339e31179d8 100644
--- a/chrome/browser/google_apis/gdata_wapi_operations.cc
+++ b/chrome/browser/google_apis/gdata_wapi_operations.cc
@@ -489,10 +489,9 @@ AddResourceToDirectoryOperation::AddResourceToDirectoryOperation(
AddResourceToDirectoryOperation::~AddResourceToDirectoryOperation() {}
GURL AddResourceToDirectoryOperation::GetURL() const {
- if (!parent_content_url_.is_empty())
- return GDataWapiUrlGenerator::AddStandardUrlParams(parent_content_url_);
-
- return url_generator_.GenerateResourceListRootUrl();
satorux1 2013/01/22 06:51:50 Is GenerateResourceListRootUrl() still used somewh
kinaba 2013/01/22 07:09:10 CreateDirectory and CopyHostedDocument still uses
+ GURL parent = parent_content_url_.is_empty() ?
+ url_generator_.GenerateRootContentUrl() : parent_content_url_;
+ return GDataWapiUrlGenerator::AddStandardUrlParams(parent);
}
URLFetcher::RequestType
@@ -523,10 +522,12 @@ bool AddResourceToDirectoryOperation::GetContentData(
RemoveResourceFromDirectoryOperation::RemoveResourceFromDirectoryOperation(
OperationRegistry* registry,
net::URLRequestContextGetter* url_request_context_getter,
+ const GDataWapiUrlGenerator& url_generator,
const EntryActionCallback& callback,
const GURL& parent_content_url,
const std::string& document_resource_id)
: EntryActionOperation(registry, url_request_context_getter, callback),
+ url_generator_(url_generator),
resource_id_(document_resource_id),
parent_content_url_(parent_content_url) {
DCHECK(!callback.is_null());
@@ -536,9 +537,12 @@ RemoveResourceFromDirectoryOperation::~RemoveResourceFromDirectoryOperation() {
}
GURL RemoveResourceFromDirectoryOperation::GetURL() const {
+ GURL parent = parent_content_url_.is_empty() ?
+ url_generator_.GenerateRootContentUrl() : parent_content_url_;
+
std::string escaped_resource_id = net::EscapePath(resource_id_);
GURL edit_url(base::StringPrintf("%s/%s",
- parent_content_url_.spec().c_str(),
+ parent.spec().c_str(),
escaped_resource_id.c_str()));
return GDataWapiUrlGenerator::AddStandardUrlParams(edit_url);
}

Powered by Google App Engine
This is Rietveld 408576698