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

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: address comments 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
« no previous file with comments | « chrome/browser/google_apis/gdata_wapi_service.h ('k') | chrome/browser/google_apis/gdata_wapi_url_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c555753adb2f6a011be5b065f718f12a4b952436 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,9 @@ const char kDriveAppsScope[] = "https://www.googleapis.com/auth/drive.apps";
} // namespace
GDataWapiService::GDataWapiService()
- : runner_(NULL) {
+ : runner_(NULL),
+ // TODO(satorux): The base URL should be injected.
+ url_generator_(GURL(gdata_wapi_url_util::kBaseUrlForProduction)) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}
@@ -146,6 +149,7 @@ void GDataWapiService::GetDocuments(
GetDocumentsOperation* operation =
new google_apis::GetDocumentsOperation(
operation_registry(),
+ url_generator_,
url,
static_cast<int>(start_changestamp),
search_query,
@@ -162,6 +166,7 @@ void GDataWapiService::GetDocumentEntry(
GetDocumentEntryOperation* operation =
new GetDocumentEntryOperation(operation_registry(),
+ url_generator_,
resource_id,
callback);
runner_->StartOperationWithRetry(operation);
@@ -172,7 +177,7 @@ void GDataWapiService::GetAccountMetadata(const GetDataCallback& callback) {
GetAccountMetadataOperation* operation =
new GetAccountMetadataOperation(
- operation_registry(), callback);
+ operation_registry(), url_generator_, callback);
runner_->StartOperationWithRetry(operation);
}
@@ -232,8 +237,11 @@ void GDataWapiService::AddNewDirectory(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
runner_->StartOperationWithRetry(
- new CreateDirectoryOperation(
- operation_registry(), callback, parent_content_url, directory_name));
+ new CreateDirectoryOperation(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));
« no previous file with comments | « chrome/browser/google_apis/gdata_wapi_service.h ('k') | chrome/browser/google_apis/gdata_wapi_url_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698