Chromium Code Reviews| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 mojo::InterfaceRequest<presentation::PresentationService> request); | 52 mojo::InterfaceRequest<presentation::PresentationService> request); |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 using ScreenAvailabilityMojoCallback = | 55 using ScreenAvailabilityMojoCallback = |
| 56 mojo::Callback<void(mojo::String, bool)>; | 56 mojo::Callback<void(mojo::String, bool)>; |
| 57 using NewSessionMojoCallback = | 57 using NewSessionMojoCallback = |
| 58 mojo::Callback<void(presentation::PresentationSessionInfoPtr, | 58 mojo::Callback<void(presentation::PresentationSessionInfoPtr, |
| 59 presentation::PresentationErrorPtr)>; | 59 presentation::PresentationErrorPtr)>; |
| 60 using DefaultSessionMojoCallback = | 60 using DefaultSessionMojoCallback = |
| 61 mojo::Callback<void(presentation::PresentationSessionInfoPtr)>; | 61 mojo::Callback<void(presentation::PresentationSessionInfoPtr)>; |
| 62 using SessionStateCallback = | |
| 63 mojo::Callback<void(presentation::PresentationSessionInfoPtr, | |
| 64 presentation::PresentationSessionState)>; | |
|
Peter Beverloo
2015/03/20 19:13:39
nit: align with (
whywhat
2015/03/24 19:20:57
Acknowledged.
| |
| 62 | 65 |
| 63 // A helper data class used by PresentationServiceImpl to do bookkeeping | 66 // A helper data class used by PresentationServiceImpl to do bookkeeping |
| 64 // of currently registered screen availability listeners. | 67 // of currently registered screen availability listeners. |
| 65 // An instance of this class is a simple state machine that waits for both | 68 // An instance of this class is a simple state machine that waits for both |
| 66 // the available bit and the Mojo callback to become available. | 69 // the available bit and the Mojo callback to become available. |
| 67 // Once this happens, the Mojo callback will be invoked with the available | 70 // Once this happens, the Mojo callback will be invoked with the available |
| 68 // bit, and the state machine will reset. | 71 // bit, and the state machine will reset. |
| 69 // The available bit is obtained from the embedder's media router. | 72 // The available bit is obtained from the embedder's media router. |
| 70 // The callback is obtained from the renderer via PresentationServiceImpl's | 73 // The callback is obtained from the renderer via PresentationServiceImpl's |
| 71 // GetScreenAvailability(). | 74 // GetScreenAvailability(). |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 157 const mojo::String& presentation_url, | 160 const mojo::String& presentation_url, |
| 158 const mojo::String& presentation_id, | 161 const mojo::String& presentation_id, |
| 159 const NewSessionMojoCallback& callback) override; | 162 const NewSessionMojoCallback& callback) override; |
| 160 void JoinSession( | 163 void JoinSession( |
| 161 const mojo::String& presentation_url, | 164 const mojo::String& presentation_url, |
| 162 const mojo::String& presentation_id, | 165 const mojo::String& presentation_id, |
| 163 const NewSessionMojoCallback& callback) override; | 166 const NewSessionMojoCallback& callback) override; |
| 164 void CloseSession( | 167 void CloseSession( |
| 165 const mojo::String& presentation_url, | 168 const mojo::String& presentation_url, |
| 166 const mojo::String& presentation_id) override; | 169 const mojo::String& presentation_id) override; |
| 170 void ListenForSessionStateChange( | |
| 171 const SessionStateCallback& callback) override; | |
| 167 | 172 |
| 168 // mojo::InterfaceImpl override. | 173 // mojo::InterfaceImpl override. |
| 169 // Note that this is called when the RenderFrameHost is deleted. | 174 // Note that this is called when the RenderFrameHost is deleted. |
| 170 void OnConnectionError() override; | 175 void OnConnectionError() override; |
| 171 | 176 |
| 172 // WebContentsObserver override. | 177 // WebContentsObserver override. |
| 173 void DidNavigateAnyFrame( | 178 void DidNavigateAnyFrame( |
| 174 content::RenderFrameHost* render_frame_host, | 179 content::RenderFrameHost* render_frame_host, |
| 175 const content::LoadCommittedDetails& details, | 180 const content::LoadCommittedDetails& details, |
| 176 const content::FrameNavigateParams& params) override; | 181 const content::FrameNavigateParams& params) override; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 235 | 240 |
| 236 // NOTE: Weak pointers must be invalidated before all other member variables. | 241 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 237 base::WeakPtrFactory<PresentationServiceImpl> weak_factory_; | 242 base::WeakPtrFactory<PresentationServiceImpl> weak_factory_; |
| 238 | 243 |
| 239 DISALLOW_COPY_AND_ASSIGN(PresentationServiceImpl); | 244 DISALLOW_COPY_AND_ASSIGN(PresentationServiceImpl); |
| 240 }; | 245 }; |
| 241 | 246 |
| 242 } // namespace content | 247 } // namespace content |
| 243 | 248 |
| 244 #endif // CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_ | 249 #endif // CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_ |
| OLD | NEW |