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

Unified Diff: chrome/browser/drive/fake_drive_service.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/fake_drive_service.cc
diff --git a/chrome/browser/drive/fake_drive_service.cc b/chrome/browser/drive/fake_drive_service.cc
index c69b2166b03cba0d4fc8678dc558c3d741ceae42..8c98e00a70643aca0452c093fbbbe14f34a9cd57 100644
--- a/chrome/browser/drive/fake_drive_service.cc
+++ b/chrome/browser/drive/fake_drive_service.cc
@@ -47,7 +47,7 @@ using google_apis::GDATA_NO_CONNECTION;
using google_apis::GDATA_OTHER_ERROR;
using google_apis::GDataErrorCode;
using google_apis::GetContentCallback;
-using google_apis::GetShareUrlCallback;
+using google_apis::GetUrlCallback;
using google_apis::HTTP_BAD_REQUEST;
using google_apis::HTTP_CREATED;
using google_apis::HTTP_NOT_FOUND;
@@ -514,10 +514,9 @@ CancelCallback FakeDriveService::GetFileResource(
return CancelCallback();
}
-CancelCallback FakeDriveService::GetShareUrl(
- const std::string& resource_id,
- const GURL& /* embed_origin */,
- const GetShareUrlCallback& callback) {
+CancelCallback FakeDriveService::GetShareUrl(const std::string& resource_id,
+ const GURL& /* embed_origin */,
+ const GetUrlCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
@@ -1400,8 +1399,10 @@ const FakeDriveService::EntryInfo* FakeDriveService::AddNewEntry(
std::string escaped_resource_id = net::EscapePath(resource_id);
- // Set mime type.
+ // Set download URL and mime type.
new_file->set_mime_type(content_type);
+ new_file->set_download_url(
+ GURL("https://xxx/content/" + escaped_resource_id));
// Set alternate link if needed.
if (content_type == util::kGoogleDocumentMimeType)

Powered by Google App Engine
This is Rietveld 408576698