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 21 matching lines...) Expand all Loading... |
32 class WebPresentationClient { | 32 class WebPresentationClient { |
33 public: | 33 public: |
34 virtual ~WebPresentationClient() {} | 34 virtual ~WebPresentationClient() {} |
35 | 35 |
36 // Passes the Blink-side delegate to the embedder. | 36 // Passes the Blink-side delegate to the embedder. |
37 virtual void setController(WebPresentationController*) = 0; | 37 virtual void setController(WebPresentationController*) = 0; |
38 | 38 |
39 // Passes the Blink-side delegate to the embedder. | 39 // Passes the Blink-side delegate to the embedder. |
40 virtual void setReceiver(WebPresentationReceiver*) = 0; | 40 virtual void setReceiver(WebPresentationReceiver*) = 0; |
41 | 41 |
42 // Called when the frame requests to start a new session. | 42 // Called when the frame requests to start a new presentation. |
43 virtual void startSession( | 43 virtual void startPresentation( |
44 const WebVector<WebURL>& presentationUrls, | 44 const WebVector<WebURL>& presentationUrls, |
45 std::unique_ptr<WebPresentationConnectionCallbacks>) = 0; | 45 std::unique_ptr<WebPresentationConnectionCallbacks>) = 0; |
46 | 46 |
47 // Called when the frame requests to join an existing session. | 47 // Called when the frame requests to reconnect to an existing presentation. |
48 virtual void joinSession( | 48 virtual void reconnectPresentation( |
49 const WebVector<WebURL>& presentationUrls, | 49 const WebVector<WebURL>& presentationUrls, |
50 const WebString& presentationId, | 50 const WebString& presentationId, |
51 std::unique_ptr<WebPresentationConnectionCallbacks>) = 0; | 51 std::unique_ptr<WebPresentationConnectionCallbacks>) = 0; |
52 | 52 |
53 // Called when the frame requests to send String message to an existing | 53 // Called when the frame requests to terminate a presentation. |
54 // session. | 54 virtual void terminatePresentation(const WebURL& presentationUrl, |
55 // |proxy|: proxy of blink connection object initiating send String message | 55 const WebString& presentationId) = 0; |
| 56 |
| 57 // Called when the frame requests to send String message to a presentation |
| 58 // via a presentation connection. |
| 59 // |proxy|: proxy of Blink connection object initiating send String message |
56 // request. Does not pass ownership. | 60 // request. Does not pass ownership. |
57 virtual void sendString(const WebURL& presentationUrl, | 61 virtual void sendString(const WebURL& presentationUrl, |
58 const WebString& presentationId, | 62 const WebString& presentationId, |
59 const WebString& message, | 63 const WebString& message, |
60 const WebPresentationConnectionProxy*) = 0; | 64 const WebPresentationConnectionProxy*) = 0; |
61 | 65 |
62 // Called when the frame requests to send ArrayBuffer/View data to an existing | 66 // Called when the frame requests to send ArrayBuffer/View data to a |
63 // session. Embedder copies the |data| and the ownership is not transferred. | 67 // presentation via a presentation connection. |
64 // |proxy|: proxy of blink connection object initiating send ArrayBuffer | 68 // Embedder copies the |data| and the ownership is not transferred. |
| 69 // |proxy|: proxy of Blink connection object initiating send ArrayBuffer |
65 // request. Does not pass ownership. | 70 // request. Does not pass ownership. |
66 virtual void sendArrayBuffer(const WebURL& presentationUrl, | 71 virtual void sendArrayBuffer(const WebURL& presentationUrl, |
67 const WebString& presentationId, | 72 const WebString& presentationId, |
68 const uint8_t* data, | 73 const uint8_t* data, |
69 size_t length, | 74 size_t length, |
70 const WebPresentationConnectionProxy*) = 0; | 75 const WebPresentationConnectionProxy*) = 0; |
71 | 76 |
72 // Called when the frame requests to send Blob data to an existing session. | 77 // Called when the frame requests to send Blob data to a presentation via a |
| 78 // presentation connection. |
| 79 // TODO(mfoltz): Combine with sendArrayBuffer? |
73 // Embedder copies the |data| and the ownership is not transferred. | 80 // Embedder copies the |data| and the ownership is not transferred. |
74 // |proxy|: proxy of blink connection object initiating send Blob data | 81 // |proxy|: proxy of blink connection object initiating send Blob data |
75 // request. Does not pass ownership. | 82 // request. Does not pass ownership. |
76 virtual void sendBlobData(const WebURL& presentationUrl, | 83 virtual void sendBlobData(const WebURL& presentationUrl, |
77 const WebString& presentationId, | 84 const WebString& presentationId, |
78 const uint8_t* data, | 85 const uint8_t* data, |
79 size_t length, | 86 size_t length, |
80 const WebPresentationConnectionProxy*) = 0; | 87 const WebPresentationConnectionProxy*) = 0; |
81 | 88 |
82 // Called when the frame requests to close an existing session. | 89 // Called when the frame requests to close its connection to the presentation. |
83 virtual void closeSession(const WebURL& presentationUrl, | 90 virtual void closeConnection(const WebURL& presentationUrl, |
84 const WebString& presentationId, | 91 const WebString& presentationId, |
85 const WebPresentationConnectionProxy*) = 0; | 92 const WebPresentationConnectionProxy*) = 0; |
86 | |
87 // Called when the frame requests to terminate an existing session. | |
88 virtual void terminateConnection(const WebURL& presentationUrl, | |
89 const WebString& presentationId) = 0; | |
90 | 93 |
91 // Called when the frame wants to know the availability of a presentation | 94 // Called when the frame wants to know the availability of a presentation |
92 // display for |availabilityUrl|. | 95 // display for |availabilityUrl|. |
93 virtual void getAvailability( | 96 virtual void getAvailability( |
94 const WebVector<WebURL>& availabilityUrls, | 97 const WebVector<WebURL>& availabilityUrls, |
95 std::unique_ptr<WebPresentationAvailabilityCallbacks>) = 0; | 98 std::unique_ptr<WebPresentationAvailabilityCallbacks>) = 0; |
96 | 99 |
97 // Start listening to changes in presentation displays availability. The | 100 // Start listening to changes in presentation displays availability. The |
98 // observer will be notified in case of a change. The observer is | 101 // observer will be notified in case of a change. The observer is |
99 // respensible to call stopListening() before being destroyed. | 102 // respensible to call stopListening() before being destroyed. |
100 virtual void startListening(WebPresentationAvailabilityObserver*) = 0; | 103 virtual void startListening(WebPresentationAvailabilityObserver*) = 0; |
101 | 104 |
102 // Stop listening to changes in presentation displays availability. The | 105 // Stop listening to changes in presentation displays availability. The |
103 // observer will no longer be notified in case of a change. | 106 // observer will no longer be notified in case of a change. |
104 virtual void stopListening(WebPresentationAvailabilityObserver*) = 0; | 107 virtual void stopListening(WebPresentationAvailabilityObserver*) = 0; |
105 | 108 |
106 // Called when a defaultRequest has been set. It sends the url associated | 109 // Called when a defaultRequest has been set. It sends the url associated |
107 // with it for the embedder. | 110 // with it for the embedder. |
108 virtual void setDefaultPresentationUrls(const WebVector<WebURL>&) = 0; | 111 virtual void setDefaultPresentationUrls(const WebVector<WebURL>&) = 0; |
109 }; | 112 }; |
110 | 113 |
111 } // namespace blink | 114 } // namespace blink |
112 | 115 |
113 #endif // WebPresentationClient_h | 116 #endif // WebPresentationClient_h |
OLD | NEW |