| 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_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_ |
| 6 #define CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_ | 6 #define CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 void StopListeningForScreenAvailability() override; | 175 void StopListeningForScreenAvailability() override; |
| 176 void ListenForDefaultSessionStart( | 176 void ListenForDefaultSessionStart( |
| 177 const DefaultSessionMojoCallback& callback) override; | 177 const DefaultSessionMojoCallback& callback) override; |
| 178 void StartSession( | 178 void StartSession( |
| 179 const mojo::String& presentation_url, | 179 const mojo::String& presentation_url, |
| 180 const NewSessionMojoCallback& callback) override; | 180 const NewSessionMojoCallback& callback) override; |
| 181 void JoinSession( | 181 void JoinSession( |
| 182 const mojo::String& presentation_url, | 182 const mojo::String& presentation_url, |
| 183 const mojo::String& presentation_id, | 183 const mojo::String& presentation_id, |
| 184 const NewSessionMojoCallback& callback) override; | 184 const NewSessionMojoCallback& callback) override; |
| 185 void SendSessionMessage( | 185 void SendSessionMessage(presentation::PresentationSessionInfoPtr session_info, |
| 186 presentation::SessionMessagePtr session_message, | 186 presentation::SessionMessagePtr session_message, |
| 187 const SendMessageMojoCallback& callback) override; | 187 const SendMessageMojoCallback& callback) override; |
| 188 void CloseSession( | 188 void CloseSession( |
| 189 const mojo::String& presentation_url, | 189 const mojo::String& presentation_url, |
| 190 const mojo::String& presentation_id) override; | 190 const mojo::String& presentation_id) override; |
| 191 void ListenForSessionStateChange() override; | 191 void ListenForSessionStateChange() override; |
| 192 void ListenForSessionMessages( | 192 void ListenForSessionMessages( |
| 193 const SessionMessagesCallback& callback) override; | 193 presentation::PresentationSessionInfoPtr session) override; |
| 194 | 194 |
| 195 // Creates a binding between this object and |request|. | 195 // Creates a binding between this object and |request|. |
| 196 void Bind(mojo::InterfaceRequest<presentation::PresentationService> request); | 196 void Bind(mojo::InterfaceRequest<presentation::PresentationService> request); |
| 197 | 197 |
| 198 // mojo::ErrorHandler override. | 198 // mojo::ErrorHandler override. |
| 199 // Note that this is called when the RenderFrameHost is deleted. | 199 // Note that this is called when the RenderFrameHost is deleted. |
| 200 void OnConnectionError() override; | 200 void OnConnectionError() override; |
| 201 | 201 |
| 202 // WebContentsObserver override. | 202 // WebContentsObserver override. |
| 203 void DidNavigateAnyFrame( | 203 void DidNavigateAnyFrame( |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 void OnJoinSessionSucceeded( | 240 void OnJoinSessionSucceeded( |
| 241 int request_session_id, | 241 int request_session_id, |
| 242 const PresentationSessionInfo& session_info); | 242 const PresentationSessionInfo& session_info); |
| 243 void OnJoinSessionError( | 243 void OnJoinSessionError( |
| 244 int request_session_id, | 244 int request_session_id, |
| 245 const PresentationError& error); | 245 const PresentationError& error); |
| 246 void OnSendMessageCallback(bool sent); | 246 void OnSendMessageCallback(bool sent); |
| 247 | 247 |
| 248 // Passed to embedder's implementation of PresentationServiceDelegate for | 248 // Passed to embedder's implementation of PresentationServiceDelegate for |
| 249 // later invocation when session messages arrive. | 249 // later invocation when session messages arrive. |
| 250 // For optimization purposes, this method will empty the messages | |
| 251 // passed to it. | |
| 252 void OnSessionMessages( | 250 void OnSessionMessages( |
| 253 scoped_ptr<ScopedVector<PresentationSessionMessage>> messages); | 251 const content::PresentationSessionInfo& session, |
| 252 const ScopedVector<PresentationSessionMessage>& messages); |
| 254 | 253 |
| 255 // Associates a JoinSession |callback| with a unique request ID and | 254 // Associates a JoinSession |callback| with a unique request ID and |
| 256 // stores it in a map. | 255 // stores it in a map. |
| 257 // Returns a positive value on success. | 256 // Returns a positive value on success. |
| 258 int RegisterJoinSessionCallback(const NewSessionMojoCallback& callback); | 257 int RegisterJoinSessionCallback(const NewSessionMojoCallback& callback); |
| 259 | 258 |
| 260 // Invoked by the embedder's PresentationServiceDelegate when a | 259 // Invoked by the embedder's PresentationServiceDelegate when a |
| 261 // presentation session's state has changed. | 260 // presentation session's state has changed. |
| 262 void OnSessionStateChanged(const PresentationSessionInfo& session_info, | 261 void OnSessionStateChanged(const PresentationSessionInfo& session_info, |
| 263 PresentationSessionState session_state); | 262 PresentationSessionState session_state); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 | 302 |
| 304 // NOTE: Weak pointers must be invalidated before all other member variables. | 303 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 305 base::WeakPtrFactory<PresentationServiceImpl> weak_factory_; | 304 base::WeakPtrFactory<PresentationServiceImpl> weak_factory_; |
| 306 | 305 |
| 307 DISALLOW_COPY_AND_ASSIGN(PresentationServiceImpl); | 306 DISALLOW_COPY_AND_ASSIGN(PresentationServiceImpl); |
| 308 }; | 307 }; |
| 309 | 308 |
| 310 } // namespace content | 309 } // namespace content |
| 311 | 310 |
| 312 #endif // CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_ | 311 #endif // CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_ |
| OLD | NEW |