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

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

Issue 22185002: Add browser test to the sharing dialog feature in Files.app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added the licence header. Created 7 years, 4 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
« no previous file with comments | « chrome/browser/drive/fake_drive_service.h ('k') | chrome/browser/resources/file_manager/js/background.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 80816f475a55d3bab5b528287eed6c899979b2bc..b090b8c18f19fc902653a5d92b881f020d745ded 100644
--- a/chrome/browser/drive/fake_drive_service.cc
+++ b/chrome/browser/drive/fake_drive_service.cc
@@ -62,10 +62,14 @@ namespace util = google_apis::util;
namespace drive {
namespace {
-// Rel property of upload link in the entries dictionary value.
+// Rel property of an upload link in the entries dictionary value.
const char kUploadUrlRel[] =
"http://schemas.google.com/g/2005#resumable-create-media";
+// Rel property of a share link in the entries dictionary value.
+const char kShareUrlRel[] =
+ "http://schemas.google.com/docs/2007#share";
+
// Returns true if a resource entry matches with the search query.
// Supports queries consist of following format.
// - Phrases quoted by double/single quotes
@@ -1389,6 +1393,13 @@ const base::DictionaryValue* FakeDriveService::AddNewEntry(
upload_link->SetString("href", upload_url.spec());
upload_link->SetString("rel", kUploadUrlRel);
links->Append(upload_link);
+
+ const GURL share_url = net::AppendOrReplaceQueryParameter(
+ share_url_base_, "name", title);
+ base::DictionaryValue* share_link = new base::DictionaryValue;
+ upload_link->SetString("href", share_url.spec());
+ upload_link->SetString("rel", kShareUrlRel);
+ links->Append(share_link);
new_entry->Set("link", links);
AddNewChangestampAndETag(new_entry.get());
« no previous file with comments | « chrome/browser/drive/fake_drive_service.h ('k') | chrome/browser/resources/file_manager/js/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698