Chromium Code Reviews| Index: public/platform/modules/presentation/WebPresentationClient.h |
| diff --git a/public/platform/modules/presentation/WebPresentationClient.h b/public/platform/modules/presentation/WebPresentationClient.h |
| index 82d740d2c1aa21e0e0fea211f2e5989fa4564e85..9e2b75cf97a253656095d9deea48e9084fa151b2 100644 |
| --- a/public/platform/modules/presentation/WebPresentationClient.h |
| +++ b/public/platform/modules/presentation/WebPresentationClient.h |
| @@ -10,6 +10,7 @@ |
| namespace blink { |
| +class WebPresentationAvailabilityObserver; |
| class WebPresentationController; |
| class WebPresentationSessionClient; |
| class WebString; |
| @@ -20,6 +21,9 @@ struct WebPresentationError; |
| // and message. |
| using WebPresentationSessionClientCallbacks = WebCallbacks<WebPresentationSessionClient, WebPresentationError>; |
| +// Callback for .getAvailability(). |
| +using WebPresentationAvailabilityCallbacks = WebCallbacks<bool, void>; |
| + |
| // The implementation the embedder has to provide for the Presentation API to work. |
| class WebPresentationClient { |
| public: |
| @@ -53,6 +57,25 @@ public: |
| // Called when the frame requests to close an existing session. |
| virtual void closeSession(const WebString& url, const WebString& presentationId) = 0; |
| + |
| + // Called when the frame wants to know the availability of a device to present. |
|
whywhat
2015/07/02 22:32:38
nit: s/device to present/presentation display/
mlamouri (slow - plz ping)
2015/07/03 13:58:26
Done.
|
| + // The ownership of the |callbacks| argument is transferred to the embedder. |
| + virtual void getAvailability(const WebString& url, WebPresentationAvailabilityCallbacks* callbacks) |
| + { |
| + // TODO(mlamouri): remove when implemented in Chromium. |
| + bool result = false; |
| + callbacks->onSuccess(&result); |
| + delete callbacks; |
| + } |
| + |
| + // Start listening to presentation device availabilities. The observer will |
|
whywhat
2015/07/02 22:32:38
nit: s/presentation device availabilities/changes
mlamouri (slow - plz ping)
2015/07/03 13:58:27
Done.
|
| + // be notified in case of a change. The observer is respensible to call |
| + // stopListening() before being destroyed. |
| + virtual void startListening(WebPresentationAvailabilityObserver*) {} |
|
whywhat
2015/07/02 22:32:38
don't you need to pass a url here too?
mlamouri (slow - plz ping)
2015/07/03 13:58:26
I guess we could but we wouldn't use it anyway. Gi
|
| + |
| + // Stop listening to presentation device availabilities. The observer will |
|
whywhat
2015/07/02 22:32:38
ditto
mlamouri (slow - plz ping)
2015/07/03 13:58:27
Done.
|
| + // no longer be notified in case of a change. |
| + virtual void stopListening(WebPresentationAvailabilityObserver*) {} |
|
whywhat
2015/07/02 22:32:38
ditto
mlamouri (slow - plz ping)
2015/07/03 13:58:26
See above.
|
| }; |
| } // namespace blink |