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

Side by Side Diff: third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp

Issue 2327713002: Revert of Use the URL passed to navigator.share(). (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/webshare/NavigatorShare.h" 5 #include "modules/webshare/NavigatorShare.h"
6 6
7 #include "core/dom/DOMException.h" 7 #include "core/dom/DOMException.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/ExceptionCode.h" 9 #include "core/dom/ExceptionCode.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 DCHECK(frame); 97 DCHECK(frame);
98 frame->interfaceProvider()->getInterface(mojo::GetProxy(&m_service)); 98 frame->interfaceProvider()->getInterface(mojo::GetProxy(&m_service));
99 DCHECK(m_service); 99 DCHECK(m_service);
100 } 100 }
101 101
102 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ; 102 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ;
103 ShareClientImpl* client = new ShareClientImpl(this, resolver); 103 ShareClientImpl* client = new ShareClientImpl(this, resolver);
104 m_clients.add(client); 104 m_clients.add(client);
105 ScriptPromise promise = resolver->promise(); 105 ScriptPromise promise = resolver->promise();
106 106
107 m_service->Share( 107 // TODO(sammc): Use shareData.url().
108 shareData.hasTitle() ? shareData.title() : emptyString(), 108 m_service->Share(shareData.hasTitle() ? shareData.title() : emptyString(), s hareData.hasText() ? shareData.text() : emptyString(), convertToBaseCallback(WTF ::bind(&ShareClientImpl::callback, wrapPersistent(client))));
109 shareData.hasText() ? shareData.text() : emptyString(),
110 doc->completeURL(shareData.url()),
111 convertToBaseCallback(WTF::bind(&ShareClientImpl::callback, wrapPersiste nt(client))));
112 109
113 return promise; 110 return promise;
114 } 111 }
115 112
116 ScriptPromise NavigatorShare::share(ScriptState* scriptState, Navigator& navigat or, const ShareData& shareData) 113 ScriptPromise NavigatorShare::share(ScriptState* scriptState, Navigator& navigat or, const ShareData& shareData)
117 { 114 {
118 return from(navigator).share(scriptState, shareData); 115 return from(navigator).share(scriptState, shareData);
119 } 116 }
120 117
121 } // namespace blink 118 } // namespace blink
OLDNEW
« 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