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

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

Issue 1430413003: [Media Router] Connection state change listening redesign part 2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile Created 5 years, 1 month 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 <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/scoped_vector.h" 13 #include "base/memory/scoped_vector.h"
14 #include "content/common/content_export.h" 14 #include "content/common/content_export.h"
15 #include "content/public/browser/presentation_session.h" 15 #include "content/public/browser/presentation_session.h"
16 #include "content/public/browser/presentation_session_message.h" 16 #include "content/public/browser/presentation_session_message.h"
17 17
18 namespace content { 18 namespace content {
19 19
20 class PresentationScreenAvailabilityListener; 20 class PresentationScreenAvailabilityListener;
21 21
22 using PresentationSessionStartedCallback = 22 using PresentationSessionStartedCallback =
23 base::Callback<void(const PresentationSessionInfo&)>; 23 base::Callback<void(const PresentationSessionInfo&)>;
24 using PresentationSessionErrorCallback = 24 using PresentationSessionErrorCallback =
25 base::Callback<void(const PresentationError&)>; 25 base::Callback<void(const PresentationError&)>;
26 using SessionStateChangedCallback = 26 using PresentationConnectionStateChangedCallback =
27 base::Callback<void(const PresentationSessionInfo&, 27 base::Callback<void(const PresentationSessionInfo&,
28 PresentationConnectionState)>; 28 PresentationConnectionState)>;
29 29
30 // Param #0: a vector of messages that are received. 30 // Param #0: a vector of messages that are received.
31 // Param #1: tells the callback handler that it may reuse strings or buffers 31 // Param #1: tells the callback handler that it may reuse strings or buffers
32 // in the messages contained within param #0. 32 // in the messages contained within param #0.
33 using PresentationSessionMessageCallback = base::Callback< 33 using PresentationSessionMessageCallback = base::Callback<
34 void(const ScopedVector<content::PresentationSessionMessage>&, bool)>; 34 void(const ScopedVector<content::PresentationSessionMessage>&, bool)>;
35 35
36 // An interface implemented by embedders to handle presentation API calls 36 // An interface implemented by embedders to handle presentation API calls
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 // |session|: The presentation session to send the message to. 161 // |session|: The presentation session to send the message to.
162 // |message|: The message to send. The embedder takes ownership of |message|. 162 // |message|: The message to send. The embedder takes ownership of |message|.
163 // Must not be null. 163 // Must not be null.
164 // |send_message_cb|: Invoked after handling the send message request. 164 // |send_message_cb|: Invoked after handling the send message request.
165 virtual void SendMessage(int render_process_id, 165 virtual void SendMessage(int render_process_id,
166 int render_frame_id, 166 int render_frame_id,
167 const content::PresentationSessionInfo& session, 167 const content::PresentationSessionInfo& session,
168 scoped_ptr<PresentationSessionMessage> message, 168 scoped_ptr<PresentationSessionMessage> message,
169 const SendMessageCallback& send_message_cb) = 0; 169 const SendMessageCallback& send_message_cb) = 0;
170 170
171 // Continuously listen for presentation session state changes for a frame. 171 // Continuously listen for state changes for a PresentationConnection in a
172 // frame.
172 // |render_process_id|, |render_frame_id|: ID of frame. 173 // |render_process_id|, |render_frame_id|: ID of frame.
173 // |state_changed_cb|: Invoked with the session and its new state whenever 174 // |connection|: PresentationConnection to listen for state changes.
174 // there is a state change. 175 // |state_changed_cb|: Invoked with the PresentationConnection and its new
175 virtual void ListenForSessionStateChange( 176 // state whenever there is a state change.
177 virtual void ListenForConnectionStateChange(
176 int render_process_id, 178 int render_process_id,
177 int render_frame_id, 179 int render_frame_id,
178 const SessionStateChangedCallback& state_changed_cb) = 0; 180 const PresentationSessionInfo& connection,
181 const PresentationConnectionStateChangedCallback& state_changed_cb) = 0;
179 }; 182 };
180 183
181 } // namespace content 184 } // namespace content
182 185
183 #endif // CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_ 186 #endif // CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698