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 |
(...skipping 28 matching lines...) Expand all Loading... |
39 public: | 39 public: |
40 virtual ~WebPresentationClient() {} | 40 virtual ~WebPresentationClient() {} |
41 | 41 |
42 // Passes the Blink-side delegate to the embedder. | 42 // Passes the Blink-side delegate to the embedder. |
43 virtual void setController(WebPresentationController*) = 0; | 43 virtual void setController(WebPresentationController*) = 0; |
44 | 44 |
45 // Passes the Blink-side delegate to the embedder. | 45 // Passes the Blink-side delegate to the embedder. |
46 virtual void setReceiver(WebPresentationReceiver*) = 0; | 46 virtual void setReceiver(WebPresentationReceiver*) = 0; |
47 | 47 |
48 // Called when the frame requests to start a new session. | 48 // Called when the frame requests to start a new session. |
49 // The ownership of the |callbacks| argument is transferred to the embedder. | 49 virtual void startSession( |
50 virtual void startSession(const WebVector<WebURL>& presentationUrls, | 50 const WebVector<WebURL>& presentationUrls, |
51 WebPresentationConnectionClientCallbacks*) = 0; | 51 std::unique_ptr<WebPresentationConnectionClientCallbacks>) = 0; |
52 | 52 |
53 // Called when the frame requests to join an existing session. | 53 // Called when the frame requests to join an existing session. |
54 // The ownership of the |callbacks| argument is transferred to the embedder. | 54 virtual void joinSession( |
55 virtual void joinSession(const WebVector<WebURL>& presentationUrls, | 55 const WebVector<WebURL>& presentationUrls, |
56 const WebString& presentationId, | 56 const WebString& presentationId, |
57 WebPresentationConnectionClientCallbacks*) = 0; | 57 std::unique_ptr<WebPresentationConnectionClientCallbacks>) = 0; |
58 | 58 |
59 // Called when the frame requests to send String message to an existing | 59 // Called when the frame requests to send String message to an existing |
60 // session. | 60 // session. |
61 virtual void sendString(const WebURL& presentationUrl, | 61 virtual void sendString(const WebURL& presentationUrl, |
62 const WebString& presentationId, | 62 const WebString& presentationId, |
63 const WebString& message) = 0; | 63 const WebString& message) = 0; |
64 | 64 |
65 // Called when the frame requests to send ArrayBuffer/View data to an existing | 65 // Called when the frame requests to send ArrayBuffer/View data to an existing |
66 // session. Embedder copies the |data| and the ownership is not transferred. | 66 // session. Embedder copies the |data| and the ownership is not transferred. |
67 virtual void sendArrayBuffer(const WebURL& presentationUrl, | 67 virtual void sendArrayBuffer(const WebURL& presentationUrl, |
(...skipping 10 matching lines...) Expand all Loading... |
78 | 78 |
79 // Called when the frame requests to close an existing session. | 79 // Called when the frame requests to close an existing session. |
80 virtual void closeSession(const WebURL& presentationUrl, | 80 virtual void closeSession(const WebURL& presentationUrl, |
81 const WebString& presentationId) = 0; | 81 const WebString& presentationId) = 0; |
82 | 82 |
83 // Called when the frame requests to terminate an existing session. | 83 // Called when the frame requests to terminate an existing session. |
84 virtual void terminateSession(const WebURL& presentationUrl, | 84 virtual void terminateSession(const WebURL& presentationUrl, |
85 const WebString& presentationId) = 0; | 85 const WebString& presentationId) = 0; |
86 | 86 |
87 // Called when the frame wants to know the availability of a presentation | 87 // Called when the frame wants to know the availability of a presentation |
88 // display for |availabilityUrl|. The ownership of the callbacks argument | 88 // display for |availabilityUrl|. |
89 // is transferred to the embedder. | 89 virtual void getAvailability( |
90 virtual void getAvailability(const WebURL& availabilityUrl, | 90 const WebURL& availabilityUrl, |
91 WebPresentationAvailabilityCallbacks*) = 0; | 91 std::unique_ptr<WebPresentationAvailabilityCallbacks>) = 0; |
92 | 92 |
93 // Start listening to changes in presentation displays availability. The | 93 // Start listening to changes in presentation displays availability. The |
94 // observer will be notified in case of a change. The observer is | 94 // observer will be notified in case of a change. The observer is |
95 // respensible to call stopListening() before being destroyed. | 95 // respensible to call stopListening() before being destroyed. |
96 virtual void startListening(WebPresentationAvailabilityObserver*) = 0; | 96 virtual void startListening(WebPresentationAvailabilityObserver*) = 0; |
97 | 97 |
98 // Stop listening to changes in presentation displays availability. The | 98 // Stop listening to changes in presentation displays availability. The |
99 // observer will no longer be notified in case of a change. | 99 // observer will no longer be notified in case of a change. |
100 virtual void stopListening(WebPresentationAvailabilityObserver*) = 0; | 100 virtual void stopListening(WebPresentationAvailabilityObserver*) = 0; |
101 | 101 |
102 // Called when a defaultRequest has been set. It sends the url associated | 102 // Called when a defaultRequest has been set. It sends the url associated |
103 // with it for the embedder. | 103 // with it for the embedder. |
104 virtual void setDefaultPresentationUrls(const WebVector<WebURL>&) = 0; | 104 virtual void setDefaultPresentationUrls(const WebVector<WebURL>&) = 0; |
105 }; | 105 }; |
106 | 106 |
107 } // namespace blink | 107 } // namespace blink |
108 | 108 |
109 #endif // WebPresentationClient_h | 109 #endif // WebPresentationClient_h |
OLD | NEW |