Commit ce6beecc authored by haibinlu's avatar haibinlu Committed by Commit bot

[PresentationAPI] Implementing CloseSession from WebPresentationClient to PresentationService.

Depends on the Blink change: https://codereview.chromium.org/1015903002

BUG=459007

Review URL: https://codereview.chromium.org/999003004

Cr-Commit-Position: refs/heads/master@{#321278}
parent a6bb2519
......@@ -256,6 +256,12 @@ void PresentationServiceImpl::SetDefaultPresentationURL(
DoSetDefaultPresentationUrl(new_default_url, default_presentation_id);
}
void PresentationServiceImpl::CloseSession(
const mojo::String& presentation_url,
const mojo::String& presentation_id) {
NOTIMPLEMENTED();
}
void PresentationServiceImpl::DidNavigateAnyFrame(
content::RenderFrameHost* render_frame_host,
const content::LoadCommittedDetails& details,
......
......@@ -161,6 +161,9 @@ class CONTENT_EXPORT PresentationServiceImpl
const mojo::String& presentation_url,
const mojo::String& presentation_id,
const NewSessionMojoCallback& callback) override;
void CloseSession(
const mojo::String& presentation_url,
const mojo::String& presentation_id) override;
// mojo::InterfaceImpl override.
// Note that this is called when the RenderFrameHost is deleted.
......
......@@ -69,4 +69,7 @@ interface PresentationService {
// silently and without user action.
JoinSession(string presentation_url, string? presentation_id)
=> (PresentationSessionInfo? sessionInfo, PresentationError? error);
// Called when closeSession() is called by the frame.
CloseSession(string presentation_url, string presentation_id);
};
......@@ -120,6 +120,16 @@ void PresentationDispatcher::joinSession(
base::Owned(callback)));
}
void PresentationDispatcher::closeSession(
const blink::WebString& presentationUrl,
const blink::WebString& presentationId) {
ConnectToPresentationServiceIfNeeded();
presentation_service_->CloseSession(
presentationUrl.utf8(),
presentationId.utf8());
}
void PresentationDispatcher::DidChangeDefaultPresentation() {
GURL presentation_url(GetPresentationURLFromFrame(render_frame()));
......
......@@ -41,6 +41,9 @@ class CONTENT_EXPORT PresentationDispatcher
const blink::WebString& presentationUrl,
const blink::WebString& presentationId,
blink::WebPresentationSessionClientCallbacks* callback);
virtual void closeSession(
const blink::WebString& presentationUrl,
const blink::WebString& presentationId);
// RenderFrameObserver
void DidChangeDefaultPresentation() override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment