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 | 10 |
10 namespace blink { | 11 namespace blink { |
11 | 12 |
12 class WebPresentationController; | 13 class WebPresentationController; |
13 class WebPresentationSessionClient; | 14 class WebPresentationSessionClient; |
14 class WebString; | 15 class WebString; |
15 struct WebPresentationError; | 16 struct WebPresentationError; |
16 | 17 |
17 // If session was created, callback's onSuccess() is invoked with the informatio n about the | 18 // If session was created, callback's onSuccess() is invoked with the informatio n about the |
18 // presentation session created by the embedder. Otherwise, onError() is invoked with the error code | 19 // presentation session created by the embedder. Otherwise, onError() is invoked with the error code |
19 // and message. | 20 // and message. |
20 using WebPresentationSessionClientCallbacks = WebCallbacks<WebPresentationSessio nClient, WebPresentationError>; | 21 using WebPresentationSessionClientCallbacks = WebCallbacks<WebPresentationSessio nClient, WebPresentationError>; |
21 | 22 |
22 // The implementation the embedder has to provide for the Presentation API to wo rk. | 23 // The implementation the embedder has to provide for the Presentation API to wo rk. |
23 class WebPresentationClient { | 24 class WebPresentationClient { |
24 public: | 25 public: |
25 virtual ~WebPresentationClient() { } | 26 virtual ~WebPresentationClient() { } |
26 | 27 |
27 // Passes the Blink-side delegate to the embedder. | 28 // Passes the Blink-side delegate to the embedder. |
28 virtual void setController(WebPresentationController*) = 0; | 29 virtual void setController(WebPresentationController*) = 0; |
29 | 30 |
30 // Called when the frame attaches the first event listener to or removes the | 31 // Called when the frame attaches the first event listener to or removes the |
31 // last event listener from the |availablechange| event. | 32 // last event listener from the |availablechange| event. |
32 virtual void updateAvailableChangeWatched(bool watched) = 0; | 33 virtual void updateAvailableChangeWatched(bool watched) = 0; |
33 | 34 |
35 // Called when the frame attaches the first event listener to or removes the | |
36 // last event listener from the |defaultpresentationstart| event. | |
37 virtual void updateDefaultPresentationStartWatched(bool watched) { BLINK_ASS ERT_NOT_REACHED(); } | |
Peter Beverloo
2015/03/03 21:19:25
nit: add a FIXME to change this to be pure virtual
whywhat
2015/03/05 18:41:47
Done.
| |
38 | |
34 // Called when the frame request to start a new session. | 39 // Called when the frame request to start a new session. |
35 // The ownership of the |callbacks| argument is transferred to the embedder. | 40 // The ownership of the |callbacks| argument is transferred to the embedder. |
36 virtual void startSession(const WebString& presentationUrl, const WebString& presentationId, WebPresentationSessionClientCallbacks*) = 0; | 41 virtual void startSession(const WebString& presentationUrl, const WebString& presentationId, WebPresentationSessionClientCallbacks*) = 0; |
37 | 42 |
38 // Called when the frame request to start a new session. | 43 // Called when the frame request to start a new session. |
39 // The ownership of the |callbacks| argument is transferred to the embedder. | 44 // The ownership of the |callbacks| argument is transferred to the embedder. |
40 virtual void joinSession(const WebString& presentationUrl, const WebString& presentationId, WebPresentationSessionClientCallbacks*) = 0; | 45 virtual void joinSession(const WebString& presentationUrl, const WebString& presentationId, WebPresentationSessionClientCallbacks*) = 0; |
41 }; | 46 }; |
42 | 47 |
43 } // namespace blink | 48 } // namespace blink |
44 | 49 |
45 #endif // WebPresentationClient_h | 50 #endif // WebPresentationClient_h |
OLD | NEW |