| Index: content/renderer/presentation/presentation_dispatcher.cc
|
| diff --git a/content/renderer/presentation/presentation_dispatcher.cc b/content/renderer/presentation/presentation_dispatcher.cc
|
| index 6a37530f70240fca9f30acca0c2155808bc11ac9..2bb5bb076b71964707d2bf0e8d952519a5969cdf 100644
|
| --- a/content/renderer/presentation/presentation_dispatcher.cc
|
| +++ b/content/renderer/presentation/presentation_dispatcher.cc
|
| @@ -384,8 +384,13 @@ void PresentationDispatcher::SetDefaultPresentationUrls(
|
|
|
| void PresentationDispatcher::SetReceiver(
|
| blink::WebPresentationReceiver* receiver) {
|
| - ConnectToPresentationServiceIfNeeded();
|
| receiver_ = receiver;
|
| +
|
| + // Create receiver PSImpl after loading document.
|
| + if (render_frame() && render_frame()->GetWebFrame() &&
|
| + !render_frame()->GetWebFrame()->IsLoading()) {
|
| + ConnectToPresentationServiceIfNeeded();
|
| + }
|
| }
|
|
|
| void PresentationDispatcher::DidCommitProvisionalLoad(
|
| @@ -401,6 +406,11 @@ void PresentationDispatcher::DidCommitProvisionalLoad(
|
| std::swap(message_request_queue_, empty);
|
| }
|
|
|
| +void PresentationDispatcher::DidFinishDocumentLoad() {
|
| + if (receiver_)
|
| + ConnectToPresentationServiceIfNeeded();
|
| +}
|
| +
|
| void PresentationDispatcher::OnDestruct() {
|
| delete this;
|
| }
|
|
|