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

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

Issue 883953002: Add content public APIs for Presentation API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed presentation_url Created 5 years, 11 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
« no previous file with comments | « content/public/browser/presentation_screen_availability_listener.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
new file mode 100644
index 0000000000000000000000000000000000000000..c527bf0383cbc44d3aebe129c31fa9cd13d73bbb
--- /dev/null
+++ b/content/public/browser/presentation_service_delegate.h
@@ -0,0 +1,65 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_
+#define CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_
+
+namespace content {
+
+class PresentationScreenAvailabilityListener;
+
+// An interface implemented by embedders to handle presentation API calls
+// forwarded from PresentationServiceImpl.
+class PresentationServiceDelegate {
+ public:
+ // Observer interface to listen for changes to PresentationServiceDelegate.
+ class Observer {
+ public:
+ // Called when the PresentationServiceDelegate is being destroyed.
+ virtual void OnDelegateDestroyed() = 0;
+
+ protected:
+ virtual ~Observer() {}
+ };
+
+ // Registers an observer with this class to listen for updates to this class.
+ // This class does not own the observer.
+ // It is an error to add an observer if it has already been added before.
+ virtual void AddObserver(Observer* observer) = 0;
+ // Unregisters an observer with this class.
+ virtual void RemoveObserver(Observer* observer) = 0;
+
+ // 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|.
+ // This class does not own |listener|.
+ // Returns true on success.
+ // This call will return false if a listener with the same presentation URL
+ // from the same frame is already registered.
+ virtual bool AddScreenAvailabilityListener(
+ int render_process_id,
+ int render_frame_id,
+ PresentationScreenAvailabilityListener* listener) = 0;
+
+ // Unregisters |listener| originated from the frame given by
+ // |render_process_id| and |render_frame_id| from this class. The listener
+ // will no longer receive availability updates.
+ virtual void RemoveScreenAvailabilityListener(
+ int render_process_id,
+ 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(
+ int render_process_id,
+ int render_frame_id) = 0;
+
+ protected:
+ virtual ~PresentationServiceDelegate() {}
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_
« no previous file with comments | « content/public/browser/presentation_screen_availability_listener.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698