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

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

Issue 2477573002: [Presentation API] (3rd) (1-UA) Split PresentationServiceDelegateImpl(PSDImpl) (Closed)
Patch Set: Created 4 years, 1 month 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 f31c01493c845f2bd169df399d8d57b6152a4029..fe878ee41cc0927418eec1599729e5a42cb7cce1 100644
--- a/content/public/browser/presentation_service_delegate.h
+++ b/content/public/browser/presentation_service_delegate.h
@@ -58,9 +58,9 @@ using ReceiverConnectionAvailableCallback =
base::Callback<void(const content::PresentationSessionInfo&,
PresentationConnectionPtr&&)>;
-// An interface implemented by embedders to handle presentation API calls
-// forwarded from PresentationServiceImpl.
-class CONTENT_EXPORT PresentationServiceDelegate {
+// Base class for ControllerPresentationServiceDelegate and
+// ReceiverPresentationServiceDelegate.
+class PresentationServiceDelegateBase {
public:
// Observer interface to listen for changes to PresentationServiceDelegate.
class CONTENT_EXPORT Observer {
@@ -72,10 +72,6 @@ class CONTENT_EXPORT PresentationServiceDelegate {
virtual ~Observer() {}
};
- using SendMessageCallback = base::Callback<void(bool)>;
-
- virtual ~PresentationServiceDelegate() {}
-
// Registers an observer associated with frame with |render_process_id|
// and |render_frame_id| with this class to listen for updates.
// This class does not own the observer.
@@ -90,6 +86,22 @@ class CONTENT_EXPORT PresentationServiceDelegate {
// The observer will no longer receive updates.
virtual void RemoveObserver(int render_process_id, int render_frame_id) = 0;
+ // 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;
+};
+
+// An interface implemented by embedders to handle presentation API calls
+// forwarded from PresentationServiceImpl.
+class CONTENT_EXPORT ControllerPresentationServiceDelegate
+ : public PresentationServiceDelegateBase {
+ public:
+ using SendMessageCallback = base::Callback<void(bool)>;
+
+ virtual ~ControllerPresentationServiceDelegate() {}
+
// Registers |listener| to continuously listen for
// availability updates for a presentation URL, originated from the frame
// given by |render_process_id| and |render_frame_id|.
@@ -110,14 +122,6 @@ class CONTENT_EXPORT PresentationServiceDelegate {
int render_frame_id,
PresentationScreenAvailabilityListener* listener) = 0;
- // 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 URLs for frame given by |render_process_id|
// and |render_frame_id|. When the default presentation is started on this
// frame, |callback| will be invoked with the corresponding
@@ -211,6 +215,31 @@ class CONTENT_EXPORT PresentationServiceDelegate {
int render_frame_id,
const PresentationSessionInfo& connection,
const PresentationConnectionStateChangedCallback& state_changed_cb) = 0;
+
+ // Connect |connection| owned by the controlling frame to the offscreen
+ // presentation represented by |session|.
+ // |render_process_id|, |render_frame_id|: ID of originating frame.
+ // |connection|: Pointer to controller's presentation connection,
+ // ownership passed from controlling frame to the offscreen presentation.
+ virtual void ConnectToOffscreenPresentation(
+ int render_process_id,
+ int render_frame_id,
+ const PresentationSessionInfo& session,
+ PresentationConnectionPtr connection) = 0;
+};
+
+// An interface implemented by embedders to handle
+// PresentationService calls from a presentation receiver.
+class CONTENT_EXPORT ReceiverPresentationServiceDelegate
+ : public PresentationServiceDelegateBase {
+ public:
+ // Registers a callback from the embedder when an offscreeen presentation has
+ // been successfully started.
+ // |receiver_available_callback|: Invoked when successfully starting a
+ // offscreen presentation session.
+ virtual void RegisterReceiverConnectionAvailableCallback(
+ const content::ReceiverConnectionAvailableCallback&
+ receiver_available_callback) = 0;
};
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698