Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Side by Side Diff: public/platform/modules/presentation/WebPresentationClient.h

Issue 940503002: [PresentationAPI] Added plumbing for start/joinSession from JS to platform (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed various lifetime issues with callbacks Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
9 #include "public/platform/WebString.h"
10
8 namespace blink { 11 namespace blink {
9 12
10 class WebPresentationController; 13 class WebPresentationController;
14 class WebPresentationSessionClient;
15 class WebString;
16
17 struct WebPresentationError;
18
19 // If session was created, callback's onSuccess() is invoked with the per-frame unique id of the
20 // presentation session interface implementation by the embedder. Otherwise, onE rror() is invoked
21 // with the error code and message.
22 using WebPresentationSessionClientCallbacks = WebCallbacks<WebString, WebPresent ationError>;
11 23
12 // The implementation the embedder has to provide for the Presentation API to wo rk. 24 // The implementation the embedder has to provide for the Presentation API to wo rk.
13 class WebPresentationClient { 25 class WebPresentationClient {
14 public: 26 public:
15 virtual ~WebPresentationClient() { } 27 virtual ~WebPresentationClient() { }
16 28
17 // Passes the Blink-side delegate to the embedder. 29 // Passes the Blink-side delegate to the embedder.
18 virtual void setController(WebPresentationController*) = 0; 30 virtual void setController(WebPresentationController*) = 0;
19 31
20 // Called when the frame attaches the first event listener to or removes the 32 // Called when the frame attaches the first event listener to or removes the
21 // last event listener from the |availablechange| event. 33 // last event listener from the |availablechange| event.
22 virtual void updateAvailableChangeWatched(bool watched) = 0; 34 virtual void updateAvailableChangeWatched(bool watched) = 0;
35
36 // Called when the frame request to start a new session.
37 // The ownership of the |callbacks| argument is transferred to the embedder.
38 virtual void startSession(const WebString& presentationUrl, const WebString& presentationId, WebPresentationSessionClientCallbacks*) = 0;
39
40 // Called when the frame request to start a new session.
41 // The ownership of the |callbacks| argument is transferred to the embedder.
42 virtual void joinSession(const WebString& presentationUrl, const WebString& presentationId, WebPresentationSessionClientCallbacks*) = 0;
23 }; 43 };
24 44
25 } // namespace blink 45 } // namespace blink
26 46
27 #endif // WebPresentationClient_h 47 #endif // WebPresentationClient_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698