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

Side by Side Diff: content/public/browser/presentation_service_delegate.h

Issue 2343013002: [Presentation API] (MR side) 1-UA: notify receiver page when receiver connection becomes available (Closed)
Patch Set: resolve code review comments from Derek Created 4 years, 3 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 CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_
6 #define CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_ 6 #define CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 29 matching lines...) Expand all
40 PresentationConnectionState state; 40 PresentationConnectionState state;
41 41
42 // |close_reason| and |messsage| are only used for state change to CLOSED. 42 // |close_reason| and |messsage| are only used for state change to CLOSED.
43 PresentationConnectionCloseReason close_reason; 43 PresentationConnectionCloseReason close_reason;
44 std::string message; 44 std::string message;
45 }; 45 };
46 46
47 using PresentationConnectionStateChangedCallback = 47 using PresentationConnectionStateChangedCallback =
48 base::Callback<void(const PresentationConnectionStateChangeInfo&)>; 48 base::Callback<void(const PresentationConnectionStateChangeInfo&)>;
49 49
50 // This class serves as a proxy to PSImpl.
51 class OffscreenPresentationClient {
52 public:
53 OffscreenPresentationClient() {}
54
55 // For controller, add a receiver client
56 // For receiver, add a controller client
57 virtual void SetOffscreenPresentationClient(OffscreenPresentationClient*) = 0;
imcheng 2016/09/28 07:28:37 param name.
imcheng 2016/09/28 07:28:37 Please document ownership of the input client.
zhaobin 2016/09/29 17:20:45 code removed in new patch
zhaobin 2016/09/29 17:20:45 code removed in new patch
58
59 virtual void RemoveOffscreenPresentationClient(
60 OffscreenPresentationClient*) = 0;
imcheng 2016/09/28 07:28:37 param name
zhaobin 2016/09/29 17:20:45 code removed in new patch
61
62 private:
63 DISALLOW_COPY_AND_ASSIGN(OffscreenPresentationClient);
imcheng 2016/09/28 07:28:37 This is not needed for interfaces.
zhaobin 2016/09/29 17:20:45 code removed in new patch
64 };
65
66 using ReceiverConnectionAvailableCallback =
67 base::Callback<void(const content::PresentationSessionInfo&,
68 OffscreenPresentationClient*)>;
69
50 // An interface implemented by embedders to handle presentation API calls 70 // An interface implemented by embedders to handle presentation API calls
51 // forwarded from PresentationServiceImpl. 71 // forwarded from PresentationServiceImpl.
52 class CONTENT_EXPORT PresentationServiceDelegate { 72 class CONTENT_EXPORT PresentationServiceDelegate {
53 public: 73 public:
54 // Observer interface to listen for changes to PresentationServiceDelegate. 74 // Observer interface to listen for changes to PresentationServiceDelegate.
55 class CONTENT_EXPORT Observer { 75 class CONTENT_EXPORT Observer {
56 public: 76 public:
57 // Called when the PresentationServiceDelegate is being destroyed. 77 // Called when the PresentationServiceDelegate is being destroyed.
58 virtual void OnDelegateDestroyed() = 0; 78 virtual void OnDelegateDestroyed() = 0;
59 79
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 // frame. 216 // frame.
197 // |render_process_id|, |render_frame_id|: ID of frame. 217 // |render_process_id|, |render_frame_id|: ID of frame.
198 // |connection|: PresentationConnection to listen for state changes. 218 // |connection|: PresentationConnection to listen for state changes.
199 // |state_changed_cb|: Invoked with the PresentationConnection and its new 219 // |state_changed_cb|: Invoked with the PresentationConnection and its new
200 // state whenever there is a state change. 220 // state whenever there is a state change.
201 virtual void ListenForConnectionStateChange( 221 virtual void ListenForConnectionStateChange(
202 int render_process_id, 222 int render_process_id,
203 int render_frame_id, 223 int render_frame_id,
204 const PresentationSessionInfo& connection, 224 const PresentationSessionInfo& connection,
205 const PresentationConnectionStateChangedCallback& state_changed_cb) = 0; 225 const PresentationConnectionStateChangedCallback& state_changed_cb) = 0;
226
227 // In receiverPSDImpl, register receiver_available_callback with
228 // OffscreenPresentationManager;
229 // In controllerPSDImpl, no-op.
230 // |receiver_available_callback|: Invoked when successfully starting a
231 // offscreen presentation session.
232 virtual void RegisterReceiverAvailableCallback(
233 const content::ReceiverConnectionAvailableCallback&
234 receiver_available_callback) = 0;
235
236 // In receiverPSDImpl, no-op;
237 // In controllerPSDImpl, register current PSImpl as an
238 // OffscreenPresentationClient object to PSDImpl.
239 // |render_process_id|, |render_frame_id|: ID of originating frame.
240 // |client|: Pointer to current PSImpl, not owned by this class. To be used in
241 // offscreen_presentation_manager->RegisterOffscreenPresentationController().
242 virtual void RegisterOffscreenPresentationClient(
243 int render_process_id,
244 int render_frame_id,
245 OffscreenPresentationClient*) = 0;
imcheng 2016/09/28 07:28:37 param name
zhaobin 2016/09/29 17:20:45 Done.
206 }; 246 };
207 247
208 } // namespace content 248 } // namespace content
209 249
210 #endif // CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_ 250 #endif // CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698