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

Unified Diff: content/public/browser/presentation_service_delegate.h

Issue 1314413005: [Presentation API] 1-UA presentation support + presenter APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments #18-21 Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
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 3005609e936722a0eb1051965e1db2446c3e758a..97e0f75c77e214e09400fa909e2ff59e8abe0599 100644
--- a/content/public/browser/presentation_service_delegate.h
+++ b/content/public/browser/presentation_service_delegate.h
@@ -26,6 +26,11 @@ class PresentationSessionStateListener;
using PresentationSessionMessageCallback = base::Callback<
void(const ScopedVector<content::PresentationSessionMessage>&, bool)>;
+using PresentationReceiverSessionAvailableCallback =
+ base::Callback<void(const content::PresentationSessionInfo*)>;
+
+using SendMessageCallback = base::Callback<void(bool)>;
+
// An interface implemented by embedders to handle presentation API calls
// forwarded from PresentationServiceImpl.
class CONTENT_EXPORT PresentationServiceDelegate {
@@ -47,11 +52,10 @@ class CONTENT_EXPORT PresentationServiceDelegate {
virtual ~Observer() {}
};
- using PresentationSessionSuccessCallback =
+ using PresentationSessionStartedCallback =
base::Callback<void(const PresentationSessionInfo&)>;
using PresentationSessionErrorCallback =
base::Callback<void(const PresentationError&)>;
- using SendMessageCallback = base::Callback<void(bool)>;
virtual ~PresentationServiceDelegate() {}
@@ -104,7 +108,8 @@ class CONTENT_EXPORT PresentationServiceDelegate {
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.
@@ -120,7 +125,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
@@ -136,7 +141,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.
@@ -179,6 +184,21 @@ class CONTENT_EXPORT PresentationServiceDelegate {
int render_process_id,
int render_frame_id,
content::PresentationSessionStateListener* listener) = 0;
+
+ // Gets a presentation session for the offscreen presentation hosted on the
+ // offscreen tab containing this frame, or waits until one is available.
+ // Runs |callback| once the receiver becomes available. |callback| will be
+ // run during this method call if the receiver is already available, or at
+ // some later time when a receiver presentation session becomes available.
+ // It is possible that |callback| will never be run if a receiver never
+ // becomes available.
+ // If |render_process_id| and |render_frame_id| do not refer to the main
+ // render frame of this WebContents, |callback| will be immediately invoked
+ // with null.
+ virtual void NotifyWhenReceiverSessionIsAvailable(
+ int render_process_id,
+ int render_frame_id,
+ const PresentationReceiverSessionAvailableCallback& callback) = 0;
};
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698