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 #include "public/platform/WebPassOwnPtr.h" |
10 | 11 |
11 namespace blink { | 12 namespace blink { |
12 | 13 |
13 class WebPresentationAvailabilityObserver; | 14 class WebPresentationAvailabilityObserver; |
14 class WebPresentationController; | 15 class WebPresentationController; |
15 class WebPresentationSessionClient; | 16 class WebPresentationSessionClient; |
16 class WebString; | 17 class WebString; |
17 struct WebPresentationError; | 18 struct WebPresentationError; |
18 | 19 |
19 // If session was created, callback's onSuccess() is invoked with the informatio
n about the | 20 // 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 | 21 // presentation session created by the embedder. Otherwise, onError() is invoked
with the error code |
21 // and message. | 22 // and message. |
22 using WebPresentationSessionClientCallbacks = WebCallbacks<WebPresentationSessio
nClient*, WebPresentationError*>; | 23 using WebPresentationSessionClientCallbacks = WebCallbacks<WebPassOwnPtr<WebPres
entationSessionClient>, WebPassOwnPtr<WebPresentationError>>; |
23 | 24 |
24 // Callback for .getAvailability(). | 25 // Callback for .getAvailability(). |
25 using WebPresentationAvailabilityCallbacks = WebCallbacks<bool*, WebPresentation
Error*>; | 26 using WebPresentationAvailabilityCallbacks = WebCallbacks<WebPassOwnPtr<bool>, W
ebPassOwnPtr<WebPresentationError>>; |
26 | 27 |
27 // The implementation the embedder has to provide for the Presentation API to wo
rk. | 28 // The implementation the embedder has to provide for the Presentation API to wo
rk. |
28 class WebPresentationClient { | 29 class WebPresentationClient { |
29 public: | 30 public: |
30 virtual ~WebPresentationClient() { } | 31 virtual ~WebPresentationClient() { } |
31 | 32 |
32 // Passes the Blink-side delegate to the embedder. | 33 // Passes the Blink-side delegate to the embedder. |
33 virtual void setController(WebPresentationController*) = 0; | 34 virtual void setController(WebPresentationController*) = 0; |
34 | 35 |
35 // Called when the frame requests to start a new session. | 36 // Called when the frame requests to start a new session. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 virtual void stopListening(WebPresentationAvailabilityObserver*) = 0; | 70 virtual void stopListening(WebPresentationAvailabilityObserver*) = 0; |
70 | 71 |
71 // Called when a defaultRequest has been set. It sends the url associated | 72 // Called when a defaultRequest has been set. It sends the url associated |
72 // with it for the embedder. | 73 // with it for the embedder. |
73 virtual void setDefaultPresentationUrl(const WebString&) = 0; | 74 virtual void setDefaultPresentationUrl(const WebString&) = 0; |
74 }; | 75 }; |
75 | 76 |
76 } // namespace blink | 77 } // namespace blink |
77 | 78 |
78 #endif // WebPresentationClient_h | 79 #endif // WebPresentationClient_h |
OLD | NEW |