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

Side by Side Diff: content/browser/presentation/presentation_service_impl.h

Issue 978543002: [Presentation API] Plumbing the |defaultpresentationstart| event from Blink to browser/Mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Expanded comment for the new Mojo method. Created 5 years, 9 months 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_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
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 ListenForDefaultPresentationStart(
86 const DefaultPresentationMojoCallback& callback) override;
83 void StartSession( 87 void StartSession(
84 const mojo::String& presentation_url, 88 const mojo::String& presentation_url,
85 const mojo::String& presentation_id, 89 const mojo::String& presentation_id,
86 const NewSessionMojoCallback& callback) override; 90 const NewSessionMojoCallback& callback) override;
87 void JoinSession( 91 void JoinSession(
88 const mojo::String& presentation_url, 92 const mojo::String& presentation_url,
89 const mojo::String& presentation_id, 93 const mojo::String& presentation_id,
90 const NewSessionMojoCallback& callback) override; 94 const NewSessionMojoCallback& callback) override;
91 95
92 // mojo::InterfaceImpl override. 96 // mojo::InterfaceImpl override.
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 availability_contexts_; 159 availability_contexts_;
156 160
157 std::string default_presentation_url_; 161 std::string default_presentation_url_;
158 162
159 DISALLOW_COPY_AND_ASSIGN(PresentationServiceImpl); 163 DISALLOW_COPY_AND_ASSIGN(PresentationServiceImpl);
160 }; 164 };
161 165
162 } // namespace content 166 } // namespace content
163 167
164 #endif // CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_ 168 #endif // CONTENT_BROWSER_PRESENTATION_PRESENTATION_SERVICE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698