| Index: content/public/browser/presentation_service_delegate.h
|
| diff --git a/content/public/browser/presentation_service_delegate.h b/content/public/browser/presentation_service_delegate.h
|
| index 5c4e5c861717cf32055d922dbe1507a0d8c95c75..ba0bf99d56bfddcb0da9e3790d335432d6d99c09 100644
|
| --- a/content/public/browser/presentation_service_delegate.h
|
| +++ b/content/public/browser/presentation_service_delegate.h
|
| @@ -19,6 +19,10 @@ namespace content {
|
|
|
| class PresentationScreenAvailabilityListener;
|
|
|
| +using PresentationSessionStartedCallback =
|
| + base::Callback<void(const PresentationSessionInfo&)>;
|
| +using PresentationSessionErrorCallback =
|
| + base::Callback<void(const PresentationError&)>;
|
| using SessionStateChangedCallback =
|
| base::Callback<void(const PresentationSessionInfo&,
|
| PresentationConnectionState)>;
|
| @@ -39,21 +43,10 @@ class CONTENT_EXPORT PresentationServiceDelegate {
|
| // Called when the PresentationServiceDelegate is being destroyed.
|
| virtual void OnDelegateDestroyed() = 0;
|
|
|
| - // Called when the default presentation has been started outside of a
|
| - // Presentation API context (e.g., browser action). This will not be called
|
| - // if the session was created as a result of Presentation API's
|
| - // StartSession()/JoinSession().
|
| - virtual void OnDefaultPresentationStarted(
|
| - const PresentationSessionInfo& session) = 0;
|
| -
|
| protected:
|
| virtual ~Observer() {}
|
| };
|
|
|
| - using PresentationSessionSuccessCallback =
|
| - base::Callback<void(const PresentationSessionInfo&)>;
|
| - using PresentationSessionErrorCallback =
|
| - base::Callback<void(const PresentationError&)>;
|
| using SendMessageCallback = base::Callback<void(bool)>;
|
|
|
| virtual ~PresentationServiceDelegate() {}
|
| @@ -101,13 +94,16 @@ class CONTENT_EXPORT PresentationServiceDelegate {
|
| int render_frame_id) = 0;
|
|
|
| // Sets the default presentation URL for frame given by |render_process_id|
|
| - // and |render_frame_id|.
|
| + // and |render_frame_id|. When the default presentation is started on this
|
| + // frame, |callback| will be invoked with the corresponding
|
| + // PresentationSessionInfo object.
|
| // If |default_presentation_url| is empty, the default presentation URL will
|
| - // be cleared.
|
| + // be cleared and the previously registered callback (if any) will be removed.
|
| virtual void SetDefaultPresentationUrl(
|
| int render_process_id,
|
| int render_frame_id,
|
| - const std::string& default_presentation_url) = 0;
|
| + const std::string& default_presentation_url,
|
| + const PresentationSessionStartedCallback& callback) = 0;
|
|
|
| // Starts a new presentation session. The presentation id of the session will
|
| // be the default presentation ID if any or a generated one otherwise.
|
| @@ -123,7 +119,7 @@ class CONTENT_EXPORT PresentationServiceDelegate {
|
| int render_process_id,
|
| int render_frame_id,
|
| const std::string& presentation_url,
|
| - const PresentationSessionSuccessCallback& success_cb,
|
| + const PresentationSessionStartedCallback& success_cb,
|
| const PresentationSessionErrorCallback& error_cb) = 0;
|
|
|
| // Joins an existing presentation session. Unlike StartSession(), this
|
| @@ -139,7 +135,7 @@ class CONTENT_EXPORT PresentationServiceDelegate {
|
| int render_frame_id,
|
| const std::string& presentation_url,
|
| const std::string& presentation_id,
|
| - const PresentationSessionSuccessCallback& success_cb,
|
| + const PresentationSessionStartedCallback& success_cb,
|
| const PresentationSessionErrorCallback& error_cb) = 0;
|
|
|
| // Close an existing presentation session.
|
|
|