| 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 5c4adf5f14bd81b9536f884963b4d5a02853fd40..3487ab9655e407dcf0e1903a75e1c924c6e3993d 100644
|
| --- a/chrome/browser/chromeos/gdata/gdata_operations.cc
|
| +++ b/chrome/browser/chromeos/gdata/gdata_operations.cc
|
| @@ -10,7 +10,6 @@
|
| #include "base/string_number_conversions.h"
|
| #include "base/values.h"
|
| #include "chrome/browser/browser_process.h"
|
| -#include "chrome/browser/chromeos/gdata/gdata_file_system.h"
|
| #include "chrome/browser/chromeos/gdata/gdata_util.h"
|
| #include "chrome/common/net/gaia/gaia_urls.h"
|
| #include "chrome/common/net/gaia/google_service_auth_error.h"
|
| @@ -68,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: ";
|
| @@ -97,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) {
|
| @@ -567,14 +576,17 @@ GURL GetDocumentEntryOperation::GetURL() const {
|
| GetAccountMetadataOperation::GetAccountMetadataOperation(
|
| GDataOperationRegistry* registry,
|
| Profile* profile,
|
| - const GetDataCallback& callback)
|
| - : GetDataOperation(registry, profile, callback) {
|
| + const GetDataCallback& callback,
|
| + bool use_drive_api)
|
| + : GetDataOperation(registry, profile, callback),
|
| + use_drive_api_(use_drive_api) {
|
| }
|
|
|
| GetAccountMetadataOperation::~GetAccountMetadataOperation() {}
|
|
|
| GURL GetAccountMetadataOperation::GetURL() const {
|
| - return AddMetadataUrlParams(GURL(kAccountMetadataURL));
|
| + return use_drive_api_ ?
|
| + GURL(kDriveV2AboutURL) : AddMetadataUrlParams(GURL(kAccountMetadataURL));
|
| }
|
|
|
| //============================ DownloadFileOperation ===========================
|
|
|