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

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

Issue 11418084: google_apis: Introduce GDataWapiUrlGenerator class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: polish Created 8 years, 1 month 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_service.cc
diff --git a/chrome/browser/google_apis/gdata_wapi_service.cc b/chrome/browser/google_apis/gdata_wapi_service.cc
index 7dfc2870beaebf347687099511cc2c9f60c4b3c5..7215936c01f494089f4a292f0f98e90423890432 100644
--- a/chrome/browser/google_apis/gdata_wapi_service.cc
+++ b/chrome/browser/google_apis/gdata_wapi_service.cc
@@ -11,6 +11,7 @@
#include "base/message_loop_proxy.h"
#include "chrome/browser/google_apis/auth_service.h"
#include "chrome/browser/google_apis/gdata_wapi_operations.h"
+#include "chrome/browser/google_apis/gdata_wapi_url_util.h"
#include "chrome/browser/google_apis/operation_runner.h"
#include "chrome/browser/google_apis/time_util.h"
#include "chrome/common/net/url_util.h"
@@ -66,7 +67,8 @@ const char kDriveAppsScope[] = "https://www.googleapis.com/auth/drive.apps";
} // namespace
GDataWapiService::GDataWapiService()
- : runner_(NULL) {
+ : runner_(NULL),
+ url_generator_(gdata_wapi_url_util::kBaseUrlForProduction) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}
@@ -146,6 +148,7 @@ void GDataWapiService::GetDocuments(
GetDocumentsOperation* operation =
new google_apis::GetDocumentsOperation(
operation_registry(),
+ url_generator_,
url,
static_cast<int>(start_changestamp),
search_query,
@@ -162,6 +165,7 @@ void GDataWapiService::GetDocumentEntry(
GetDocumentEntryOperation* operation =
new GetDocumentEntryOperation(operation_registry(),
+ url_generator_,
resource_id,
callback);
runner_->StartOperationWithRetry(operation);
@@ -172,7 +176,7 @@ void GDataWapiService::GetAccountMetadata(const GetDataCallback& callback) {
GetAccountMetadataOperation* operation =
new GetAccountMetadataOperation(
- operation_registry(), callback);
+ operation_registry(), url_generator_, callback);
runner_->StartOperationWithRetry(operation);
}
@@ -233,7 +237,11 @@ void GDataWapiService::AddNewDirectory(
runner_->StartOperationWithRetry(
new CreateDirectoryOperation(
hashimoto 2012/11/20 09:10:17 nit: Can't we save one newline here?
satorux1 2012/11/21 00:34:18 Done.
- operation_registry(), callback, parent_content_url, directory_name));
+ operation_registry(),
+ url_generator_,
+ callback,
+ parent_content_url,
+ directory_name));
}
void GDataWapiService::CopyDocument(
@@ -243,8 +251,11 @@ void GDataWapiService::CopyDocument(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
runner_->StartOperationWithRetry(
- new CopyDocumentOperation(operation_registry(), callback,
- resource_id, new_name));
+ new CopyDocumentOperation(operation_registry(),
+ url_generator_,
+ callback,
+ resource_id,
+ new_name));
}
void GDataWapiService::RenameResource(
@@ -266,6 +277,7 @@ void GDataWapiService::AddResourceToDirectory(
runner_->StartOperationWithRetry(
new AddResourceToDirectoryOperation(operation_registry(),
+ url_generator_,
callback,
parent_content_url,
resource_url));

Powered by Google App Engine
This is Rietveld 408576698