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

Unified Diff: chrome/browser/drive/drive_api_util.cc

Issue 371883003: Files.app: Add an private API to get a download URL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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/drive/drive_api_util.cc
diff --git a/chrome/browser/drive/drive_api_util.cc b/chrome/browser/drive/drive_api_util.cc
index 13cefa6c91ffa4dbbe199e0393d57cd1f6d5c8fc..354914c952ffc93fc83ddcff683f55bec3028e8c 100644
--- a/chrome/browser/drive/drive_api_util.cc
+++ b/chrome/browser/drive/drive_api_util.cc
@@ -150,7 +150,7 @@ ResourceIdCanonicalizer GetIdentityResourceIdCanonicalizer() {
const char kDocsListScope[] = "https://docs.google.com/feeds/";
const char kDriveAppsScope[] = "https://www.googleapis.com/auth/drive.apps";
-void ParseShareUrlAndRun(const google_apis::GetShareUrlCallback& callback,
+void ParseShareUrlAndRun(const google_apis::GetUrlCallback& callback,
google_apis::GDataErrorCode error,
scoped_ptr<base::Value> value) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
@@ -191,6 +191,7 @@ scoped_ptr<google_apis::FileResource> ConvertResourceEntryToFileResource(
file->set_shared(std::find(entry.labels().begin(), entry.labels().end(),
"shared") != entry.labels().end());
+ file->set_download_url(entry.download_url());
if (entry.is_folder()) {
file->set_mime_type(kDriveFolderMimeType);
} else {
@@ -286,6 +287,7 @@ ConvertFileResourceToResourceEntry(
// This should be the url to download the file_resource.
{
google_apis::Content content;
+ content.set_url(file_resource.download_url());
content.set_mime_type(file_resource.mime_type());
entry->set_content(content);
}

Powered by Google App Engine
This is Rietveld 408576698