Chromium Code Reviews| 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 2929c47c5d9f5e4869ba1b1e1713453ad8fdd2b7..9dd58f15c840a20ffd988b46f391786688882f87 100644 |
| --- a/content/public/browser/presentation_service_delegate.h |
| +++ b/content/public/browser/presentation_service_delegate.h |
| @@ -5,7 +5,9 @@ |
| #ifndef CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_ |
| #define CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_ |
| +#include "base/callback.h" |
| #include "content/common/content_export.h" |
| +#include "content/public/browser/presentation_session.h" |
| namespace content { |
| @@ -25,6 +27,11 @@ class CONTENT_EXPORT PresentationServiceDelegate { |
| virtual ~Observer() {} |
| }; |
| + using PresentationSessionSuccessCallback = |
| + base::Callback<void(const PresentationSessionInfo&)>; |
| + using PresentationSessionErrorCallback = |
| + base::Callback<void(const PresentationError&)>; |
| + |
| virtual ~PresentationServiceDelegate() {} |
| // Registers an observer with this class to listen for updates to this class. |
| @@ -54,11 +61,61 @@ class CONTENT_EXPORT PresentationServiceDelegate { |
| int render_frame_id, |
| PresentationScreenAvailabilityListener* listener) = 0; |
| - // Unregisters all listeners associated with the frame given by |
| - // |render_process_id| and |render_frame_id|. |
| - virtual void RemoveAllScreenAvailabilityListeners( |
| + // Resets the presentation state for the frame given by |render_process_id| |
| + // and |render_frame_id|. |
| + // This unregisters all listeners associated with the given frame, and clears |
| + // the default presentation URL and ID set for the frame. |
| + virtual void Reset( |
| int render_process_id, |
| int render_frame_id) = 0; |
| + |
| + // Sets the default presentation URL and ID for frame given by |
| + // |render_process_id| and |render_frame_id|. |
| + // If |default_presentation_url| is empty, the default presentation URL will |
| + // be cleared. |
| + virtual void SetDefaultPresentationUrl( |
| + int render_process_id, |
| + int render_frame_id, |
| + const std::string& default_presentation_url, |
| + const std::string& default_presentation_id) = 0; |
| + |
| + // Starts a new presentation session. |
| + // This brings up a screen list for the user to select a screen to |
|
mark a. foltz
2015/03/18 00:10:58
Actually that's up to the embedder :)
Maybe, "Typ
imcheng
2015/03/18 00:56:53
Done.
|
| + // establish the presentation session on. |
| + // |render_process_id|, |render_frame_id|: ID of originating frame. |
| + // |presentation_url|: URL of the presentation. If empty, fall back to |
|
mark a. foltz
2015/03/18 00:10:58
presentation_url should be mandatory for all calls
imcheng
2015/03/18 00:56:53
Done.
|
| + // falling back on "1-UA" mode, i.e. offscreen tab rendering. |
| + // |presentation_id|: The caller may provide an non-empty string to be used |
| + // as the ID of the presentation. If this is an empty string, the embedder |
| + // will automatically generate one. |
| + // |success_cb|: Invoked with session info, if presentation session started |
| + // successfully. |
| + // |error_cb|: Invoked with error reason, if presentation session did not |
| + // start. |
| + virtual void StartSession( |
| + int render_process_id, |
| + int render_frame_id, |
| + const std::string& presentation_url, |
| + const std::string& presentation_id, |
| + const PresentationSessionSuccessCallback& success_cb, |
| + const PresentationSessionErrorCallback& error_cb) = 0; |
| + |
| + // Joins an existing presentation session. Unlike StartSession(), this |
| + // does not bring a screen list UI. |
| + // |render_process_id|, |render_frame_id|: ID for originating frame. |
| + // |presentation_url|: URL of the presentation. If empty, fall back to |
|
mark a. foltz
2015/03/18 00:10:58
Also mandatory for joinSession().
imcheng
2015/03/18 00:56:53
Done.
|
| + // falling back on "1-UA" mode, i.e. offscreen tab rendering. |
| + // |presentation_id|: The ID of the presentation to join. |
| + // |success_cb|: Invoked with session info, if presentation session joined |
| + // successfully. |
| + // |error_cb|: Invoked with error reason, if joining failed. |
| + virtual void JoinSession( |
| + int render_process_id, |
| + int render_frame_id, |
| + const std::string& presentation_url, |
| + const std::string& presentation_id, |
| + const PresentationSessionSuccessCallback& success_cb, |
| + const PresentationSessionErrorCallback& error_cb) = 0; |
| }; |
| } // namespace content |