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

Unified Diff: third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp

Issue 2309403002: Use the URL passed to navigator.share(). (Closed)
Patch Set: rebase Created 4 years, 3 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: third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp
diff --git a/third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp b/third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp
index 87fa7f0e4d439a2c58a7e702d0a31b8c1103b68c..846718089bbe4a232f1646b2c32ce259bc364aca 100644
--- a/third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp
+++ b/third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp
@@ -87,9 +87,9 @@ ScriptPromise NavigatorShare::share(ScriptState* scriptState, const ShareData& s
return ScriptPromise::rejectWithDOMException(scriptState, error);
}
+ Document* doc = toDocument(scriptState->getExecutionContext());
+ DCHECK(doc);
if (!m_service) {
- Document* doc = toDocument(scriptState->getExecutionContext());
- DCHECK(doc);
LocalFrame* frame = doc->frame();
DCHECK(frame);
frame->interfaceProvider()->getInterface(mojo::GetProxy(&m_service));
@@ -101,8 +101,11 @@ ScriptPromise NavigatorShare::share(ScriptState* scriptState, const ShareData& s
m_clients.add(client);
ScriptPromise promise = resolver->promise();
- // TODO(sammc): Use shareData.url().
- m_service->Share(shareData.hasTitle() ? shareData.title() : emptyString(), shareData.hasText() ? shareData.text() : emptyString(), convertToBaseCallback(WTF::bind(&ShareClientImpl::callback, wrapPersistent(client))));
+ m_service->Share(
+ shareData.hasTitle() ? shareData.title() : emptyString(),
+ shareData.hasText() ? shareData.text() : emptyString(),
+ doc->completeURL(shareData.url()),
+ convertToBaseCallback(WTF::bind(&ShareClientImpl::callback, wrapPersistent(client))));
return promise;
}
« no previous file with comments | « third_party/WebKit/LayoutTests/webshare/share-without-user-gesture.html ('k') | third_party/WebKit/public/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698