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 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> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/memory/scoped_vector.h" | |
14 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
15 #include "content/public/browser/presentation_connection_message.h" | 14 #include "content/public/browser/presentation_connection_message.h" |
16 #include "content/public/browser/presentation_session.h" | 15 #include "content/public/browser/presentation_session.h" |
17 | 16 |
18 class GURL; | 17 class GURL; |
19 | 18 |
20 namespace content { | 19 namespace content { |
21 | 20 |
22 class PresentationScreenAvailabilityListener; | 21 class PresentationScreenAvailabilityListener; |
23 | 22 |
24 using PresentationSessionStartedCallback = | 23 using PresentationSessionStartedCallback = |
25 base::Callback<void(const PresentationSessionInfo&)>; | 24 base::Callback<void(const PresentationSessionInfo&)>; |
26 using PresentationSessionErrorCallback = | 25 using PresentationSessionErrorCallback = |
27 base::Callback<void(const PresentationError&)>; | 26 base::Callback<void(const PresentationError&)>; |
28 | 27 |
29 // Param #0: a vector of messages that are received. | 28 // Param #0: a vector of messages that are received. |
30 // Param #1: tells the callback handler that it may reuse strings or buffers | 29 // Param #1: tells the callback handler that it may reuse strings or buffers |
31 // in the messages contained within param #0. | 30 // in the messages contained within param #0. |
32 using PresentationConnectionMessageCallback = base::Callback< | 31 using PresentationConnectionMessageCallback = base::Callback<void( |
33 void(const ScopedVector<content::PresentationConnectionMessage>&, bool)>; | 32 const std::vector<std::unique_ptr<content::PresentationConnectionMessage>>&, |
| 33 bool)>; |
34 | 34 |
35 struct PresentationConnectionStateChangeInfo { | 35 struct PresentationConnectionStateChangeInfo { |
36 explicit PresentationConnectionStateChangeInfo( | 36 explicit PresentationConnectionStateChangeInfo( |
37 PresentationConnectionState state) | 37 PresentationConnectionState state) |
38 : state(state), | 38 : state(state), |
39 close_reason(PRESENTATION_CONNECTION_CLOSE_REASON_CONNECTION_ERROR) {} | 39 close_reason(PRESENTATION_CONNECTION_CLOSE_REASON_CONNECTION_ERROR) {} |
40 ~PresentationConnectionStateChangeInfo() = default; | 40 ~PresentationConnectionStateChangeInfo() = default; |
41 | 41 |
42 PresentationConnectionState state; | 42 PresentationConnectionState state; |
43 | 43 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 virtual void ListenForConnectionStateChange( | 201 virtual void ListenForConnectionStateChange( |
202 int render_process_id, | 202 int render_process_id, |
203 int render_frame_id, | 203 int render_frame_id, |
204 const PresentationSessionInfo& connection, | 204 const PresentationSessionInfo& connection, |
205 const PresentationConnectionStateChangedCallback& state_changed_cb) = 0; | 205 const PresentationConnectionStateChangedCallback& state_changed_cb) = 0; |
206 }; | 206 }; |
207 | 207 |
208 } // namespace content | 208 } // namespace content |
209 | 209 |
210 #endif // CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_ | 210 #endif // CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_ |
OLD | NEW |