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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // |request|: The instance will be bound to this request. Used for Mojo setup. | 47 // |request|: The instance will be bound to this request. Used for Mojo setup. |
48 static void CreateMojoService( | 48 static void CreateMojoService( |
49 RenderFrameHost* render_frame_host, | 49 RenderFrameHost* render_frame_host, |
50 mojo::InterfaceRequest<presentation::PresentationService> request); | 50 mojo::InterfaceRequest<presentation::PresentationService> request); |
51 | 51 |
52 private: | 52 private: |
53 using ScreenAvailabilityMojoCallback = mojo::Callback<void(bool)>; | 53 using ScreenAvailabilityMojoCallback = mojo::Callback<void(bool)>; |
54 using NewSessionMojoCallback = | 54 using NewSessionMojoCallback = |
55 mojo::Callback<void(presentation::PresentationSessionInfoPtr, | 55 mojo::Callback<void(presentation::PresentationSessionInfoPtr, |
56 presentation::PresentationErrorPtr)>; | 56 presentation::PresentationErrorPtr)>; |
| 57 using DefaultPresentationMojoCallback = |
| 58 mojo::Callback<void(presentation::PresentationSessionInfoPtr)>; |
57 | 59 |
58 friend class PresentationServiceImplTest; | 60 friend class PresentationServiceImplTest; |
59 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, RemoveAllListeners); | 61 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, RemoveAllListeners); |
60 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, | 62 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, |
61 DidNavigateThisFrame); | 63 DidNavigateThisFrame); |
62 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, | 64 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, |
63 DidNavigateNotThisFrame); | 65 DidNavigateNotThisFrame); |
64 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, | 66 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, |
65 ThisRenderFrameDeleted); | 67 ThisRenderFrameDeleted); |
66 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, | 68 FRIEND_TEST_ALL_PREFIXES(PresentationServiceImplTest, |
67 NotThisRenderFrameDeleted); | 69 NotThisRenderFrameDeleted); |
68 | 70 |
69 // |render_frame_host|: The RFH this instance is associated with. | 71 // |render_frame_host|: The RFH this instance is associated with. |
70 // |web_contents|: The WebContents to observe. | 72 // |web_contents|: The WebContents to observe. |
71 // |delegate|: Where Presentation API requests are delegated to. Not owned | 73 // |delegate|: Where Presentation API requests are delegated to. Not owned |
72 // by this class. | 74 // by this class. |
73 PresentationServiceImpl( | 75 PresentationServiceImpl( |
74 RenderFrameHost* render_frame_host, | 76 RenderFrameHost* render_frame_host, |
75 WebContents* web_contents, | 77 WebContents* web_contents, |
76 PresentationServiceDelegate* delegate); | 78 PresentationServiceDelegate* delegate); |
77 | 79 |
78 // PresentationService implementation. | 80 // PresentationService implementation. |
79 void GetScreenAvailability( | 81 void GetScreenAvailability( |
80 const mojo::String& presentation_url, | 82 const mojo::String& presentation_url, |
81 const ScreenAvailabilityMojoCallback& callback) override; | 83 const ScreenAvailabilityMojoCallback& callback) override; |
82 void OnScreenAvailabilityListenerRemoved() override; | 84 void OnScreenAvailabilityListenerRemoved() override; |
| 85 void WaitForDefaultPresentation( |
| 86 const DefaultPresentationMojoCallback& callback) override; |
| 87 void OnDefaultPresentationListenerRemoved() override; |
83 void StartSession( | 88 void StartSession( |
84 const mojo::String& presentation_url, | 89 const mojo::String& presentation_url, |
85 const mojo::String& presentation_id, | 90 const mojo::String& presentation_id, |
86 const NewSessionMojoCallback& callback) override; | 91 const NewSessionMojoCallback& callback) override; |
87 void JoinSession( | 92 void JoinSession( |
88 const mojo::String& presentation_url, | 93 const mojo::String& presentation_url, |
89 const mojo::String& presentation_id, | 94 const mojo::String& presentation_id, |
90 const NewSessionMojoCallback& callback) override; | 95 const NewSessionMojoCallback& callback) override; |
91 | 96 |
92 // mojo::InterfaceImpl override. | 97 // mojo::InterfaceImpl override. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 availability_contexts_; | 160 availability_contexts_; |
156 | 161 |
157 std::string default_presentation_url_; | 162 std::string default_presentation_url_; |
158 | 163 |
159 DISALLOW_COPY_AND_ASSIGN(PresentationServiceImpl); | 164 DISALLOW_COPY_AND_ASSIGN(PresentationServiceImpl); |
160 }; | 165 }; |
161 | 166 |
162 } // namespace content | 167 } // namespace content |
163 | 168 |
164 #endif // CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_ | 169 #endif // CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_ |
OLD | NEW |