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

Unified Diff: chrome/browser/chromeos/gdata/gdata_operations.cc

Issue 10693109: Use Drive v2 API: enable behind --enable-drive-api flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove boolean use_drive_api Created 8 years, 5 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/gdata/gdata_operations.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_operations.cc b/chrome/browser/chromeos/gdata/gdata_operations.cc
index be05e1e2350404e33edbaf50ef3618128468a289..8e9961cbdc56aa5c2f2f52bcd1cab74bd68394f8 100644
--- a/chrome/browser/chromeos/gdata/gdata_operations.cc
+++ b/chrome/browser/chromeos/gdata/gdata_operations.cc
@@ -67,6 +67,9 @@ const char kGetDocumentEntryURLFormat[] =
const char kAccountMetadataURL[] =
"https://docs.google.com/feeds/metadata/default";
+const char kDriveV2AboutURL[] =
+ "https://www.googleapis.com/drive/v2/about";
+
const char kUploadContentRange[] = "Content-Range: bytes ";
const char kUploadContentType[] = "X-Upload-Content-Type: ";
const char kUploadContentLength[] = "X-Upload-Content-Length: ";
@@ -96,6 +99,13 @@ const char kDocsListScope[] = "https://docs.google.com/feeds/";
const char kSpreadsheetsScope[] = "https://spreadsheets.google.com/feeds/";
const char kUserContentScope[] = "https://docs.googleusercontent.com/";
+// OAuth scope for Google Drive v2 API
+// See https://developers.google.com/drive/scopes.
+// Tokens with scope https://docs.google.com/feeds are accepted and treated
+// the same as tokens with scope https://www.googleapis.com/auth/drive and
+// this is not necessary for the migration period.
+const char kDriveScope[] = "https://www.googleapis.com/auth/drive";
+
// Adds additional parameters for API version, output content type and to show
// folders in the feed are added to document feed URLs.
GURL AddStandardUrlParams(const GURL& url) {
@@ -573,7 +583,8 @@ GetAccountMetadataOperation::GetAccountMetadataOperation(
GetAccountMetadataOperation::~GetAccountMetadataOperation() {}
GURL GetAccountMetadataOperation::GetURL() const {
- return AddMetadataUrlParams(GURL(kAccountMetadataURL));
+ return gdata::util::IsDriveV2ApiEnabled() ?
+ GURL(kDriveV2AboutURL) : AddMetadataUrlParams(GURL(kAccountMetadataURL));
}
satorux1 2012/07/12 07:49:06 Not sure if it's worth sharing GetAccountMetadataO
kochi 2012/07/13 10:33:52 gdata_operations.cc split is done: https://src.chr
//============================ DownloadFileOperation ===========================

Powered by Google App Engine
This is Rietveld 408576698