| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WebPresentationClient_h | 5 #ifndef WebPresentationClient_h |
| 6 #define WebPresentationClient_h | 6 #define WebPresentationClient_h |
| 7 | 7 |
| 8 #include "public/platform/WebCallbacks.h" | 8 #include "public/platform/WebCallbacks.h" |
| 9 #include "public/platform/WebCommon.h" | 9 #include "public/platform/WebCommon.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class WebPresentationAvailabilityObserver; | 13 class WebPresentationAvailabilityObserver; |
| 14 class WebPresentationController; | 14 class WebPresentationController; |
| 15 class WebPresentationSessionClient; | 15 class WebPresentationSessionClient; |
| 16 class WebString; | 16 class WebString; |
| 17 struct WebPresentationError; | 17 struct WebPresentationError; |
| 18 | 18 |
| 19 // If session was created, callback's onSuccess() is invoked with the informatio
n about the | 19 // If session was created, callback's onSuccess() is invoked with the informatio
n about the |
| 20 // presentation session created by the embedder. Otherwise, onError() is invoked
with the error code | 20 // presentation session created by the embedder. Otherwise, onError() is invoked
with the error code |
| 21 // and message. | 21 // and message. |
| 22 using WebPresentationSessionClientCallbacks = WebCallbacks<WebPresentationSessio
nClient, WebPresentationError>; | 22 using WebPresentationSessionClientCallbacks = WebCallbacks<WebPresentationSessio
nClient, WebPresentationError>; |
| 23 | 23 |
| 24 // Callback for .getAvailability(). | 24 // Callback for .getAvailability(). |
| 25 using WebPresentationAvailabilityCallbacks = WebCallbacks<bool, void>; | 25 using WebPresentationAvailabilityCallbacks = WebCallbacks<bool, WebPresentationE
rror>; |
| 26 | 26 |
| 27 // The implementation the embedder has to provide for the Presentation API to wo
rk. | 27 // The implementation the embedder has to provide for the Presentation API to wo
rk. |
| 28 class WebPresentationClient { | 28 class WebPresentationClient { |
| 29 public: | 29 public: |
| 30 virtual ~WebPresentationClient() { } | 30 virtual ~WebPresentationClient() { } |
| 31 | 31 |
| 32 // Passes the Blink-side delegate to the embedder. | 32 // Passes the Blink-side delegate to the embedder. |
| 33 virtual void setController(WebPresentationController*) = 0; | 33 virtual void setController(WebPresentationController*) = 0; |
| 34 | 34 |
| 35 // Called when the frame requests to start a new session. | 35 // Called when the frame requests to start a new session. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 65 virtual void startListening(WebPresentationAvailabilityObserver*) = 0; | 65 virtual void startListening(WebPresentationAvailabilityObserver*) = 0; |
| 66 | 66 |
| 67 // Stop listening to changes in presentation displays availability. The | 67 // Stop listening to changes in presentation displays availability. The |
| 68 // observer will no longer be notified in case of a change. | 68 // observer will no longer be notified in case of a change. |
| 69 virtual void stopListening(WebPresentationAvailabilityObserver*) = 0; | 69 virtual void stopListening(WebPresentationAvailabilityObserver*) = 0; |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 } // namespace blink | 72 } // namespace blink |
| 73 | 73 |
| 74 #endif // WebPresentationClient_h | 74 #endif // WebPresentationClient_h |
| OLD | NEW |