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

Side by Side Diff: chrome/browser/media/router/presentation_service_delegate_impl.h

Issue 2343013002: [Presentation API] (MR side) 1-UA: notify receiver page when receiver connection becomes available (Closed)
Patch Set: resolve code review comments from Derek Created 4 years, 3 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 CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_IMPL_H_ 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_IMPL_H_
6 #define CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_IMPL_H_ 6 #define CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 17 matching lines...) Expand all
28 class PresentationScreenAvailabilityListener; 28 class PresentationScreenAvailabilityListener;
29 class WebContents; 29 class WebContents;
30 struct PresentationSessionInfo; 30 struct PresentationSessionInfo;
31 struct PresentationSessionMessage; 31 struct PresentationSessionMessage;
32 } // namespace content 32 } // namespace content
33 33
34 namespace media_router { 34 namespace media_router {
35 35
36 class MediaRoute; 36 class MediaRoute;
37 class MediaSinksObserver; 37 class MediaSinksObserver;
38 class OffscreenPresentationManager;
38 class PresentationFrameManager; 39 class PresentationFrameManager;
39 class RouteRequestResult; 40 class RouteRequestResult;
40 41
41 // Implementation of PresentationServiceDelegate that interfaces an 42 // Implementation of PresentationServiceDelegate that interfaces an
42 // instance of WebContents with the Chrome Media Router. It uses the Media 43 // instance of WebContents with the Chrome Media Router. It uses the Media
43 // Router to handle presentation API calls forwarded from 44 // Router to handle presentation API calls forwarded from
44 // PresentationServiceImpl. In addition, it also 45 // PresentationServiceImpl. In addition, it also
45 // provides default presentation URL that is required for creating 46 // provides default presentation URL that is required for creating
46 // browser-initiated sessions. 47 // browser-initiated sessions.
47 // It is scoped to the lifetime of a WebContents, and is managed by the 48 // It is scoped to the lifetime of a WebContents, and is managed by the
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 void SendMessage(int render_process_id, 123 void SendMessage(int render_process_id,
123 int render_frame_id, 124 int render_frame_id,
124 const content::PresentationSessionInfo& session, 125 const content::PresentationSessionInfo& session,
125 std::unique_ptr<content::PresentationSessionMessage> message, 126 std::unique_ptr<content::PresentationSessionMessage> message,
126 const SendMessageCallback& send_message_cb) override; 127 const SendMessageCallback& send_message_cb) override;
127 void ListenForConnectionStateChange( 128 void ListenForConnectionStateChange(
128 int render_process_id, 129 int render_process_id,
129 int render_frame_id, 130 int render_frame_id,
130 const content::PresentationSessionInfo& connection, 131 const content::PresentationSessionInfo& connection,
131 const content::PresentationConnectionStateChangedCallback& 132 const content::PresentationConnectionStateChangedCallback&
132 state_changed_cb) override; 133 state_changed_cb) override;
imcheng 2016/09/28 07:28:37 nit: add back the empty line to separate PSD imple
zhaobin 2016/09/29 17:20:44 Done.
133
134 // Callback invoked when a default PresentationRequest is started from a 134 // Callback invoked when a default PresentationRequest is started from a
135 // browser-initiated dialog. 135 // browser-initiated dialog.
136 void OnRouteResponse(const PresentationRequest& request, 136 void OnRouteResponse(const PresentationRequest& request,
137 const RouteRequestResult& result); 137 const RouteRequestResult& result);
138 138
139 // Adds / removes an observer for listening to default PresentationRequest 139 // Adds / removes an observer for listening to default PresentationRequest
140 // changes. This class does not own |observer|. When |observer| is about to 140 // changes. This class does not own |observer|. When |observer| is about to
141 // be destroyed, |RemoveDefaultPresentationRequestObserver| must be called. 141 // be destroyed, |RemoveDefaultPresentationRequestObserver| must be called.
142 void AddDefaultPresentationRequestObserver( 142 void AddDefaultPresentationRequestObserver(
143 DefaultPresentationRequestObserver* observer); 143 DefaultPresentationRequestObserver* observer);
(...skipping 13 matching lines...) Expand all
157 content::WebContents* web_contents() const { return web_contents_; } 157 content::WebContents* web_contents() const { return web_contents_; }
158 158
159 base::WeakPtr<PresentationServiceDelegateImpl> GetWeakPtr(); 159 base::WeakPtr<PresentationServiceDelegateImpl> GetWeakPtr();
160 160
161 void SetMediaRouterForTest(MediaRouter* router); 161 void SetMediaRouterForTest(MediaRouter* router);
162 bool HasScreenAvailabilityListenerForTest( 162 bool HasScreenAvailabilityListenerForTest(
163 int render_process_id, 163 int render_process_id,
164 int render_frame_id, 164 int render_frame_id,
165 const MediaSource::Id& source_id) const; 165 const MediaSource::Id& source_id) const;
166 166
167 void RegisterReceiverAvailableCallback(
imcheng 2016/09/28 07:28:37 Move these up to group them with the rest of PSD m
zhaobin 2016/09/29 17:20:44 Done.
168 const content::ReceiverConnectionAvailableCallback&
169 receiver_available_callback) override {}
imcheng 2016/09/28 07:28:37 Add a NOTREACHED() since we don't expect this to b
zhaobin 2016/09/29 17:20:44 Done.
170
171 void RegisterOffscreenPresentationClient(
172 int render_process_id,
173 int render_frame_id,
174 content::OffscreenPresentationClient*) override;
imcheng 2016/09/28 07:28:37 Please name the client parameter
zhaobin 2016/09/29 17:20:44 Done.
175
167 private: 176 private:
168 friend class content::WebContentsUserData<PresentationServiceDelegateImpl>; 177 friend class content::WebContentsUserData<PresentationServiceDelegateImpl>;
169 FRIEND_TEST_ALL_PREFIXES(PresentationServiceDelegateImplTest, 178 FRIEND_TEST_ALL_PREFIXES(PresentationServiceDelegateImplTest,
170 DelegateObservers); 179 DelegateObservers);
171 FRIEND_TEST_ALL_PREFIXES(PresentationServiceDelegateImplTest, 180 FRIEND_TEST_ALL_PREFIXES(PresentationServiceDelegateImplTest,
172 SetDefaultPresentationUrl); 181 SetDefaultPresentationUrl);
173 FRIEND_TEST_ALL_PREFIXES(PresentationServiceDelegateImplTest, 182 FRIEND_TEST_ALL_PREFIXES(PresentationServiceDelegateImplTest,
174 DefaultPresentationRequestObserver); 183 DefaultPresentationRequestObserver);
175 FRIEND_TEST_ALL_PREFIXES(PresentationServiceDelegateImplTest, 184 FRIEND_TEST_ALL_PREFIXES(PresentationServiceDelegateImplTest,
176 DefaultPresentationUrlCallback); 185 DefaultPresentationUrlCallback);
(...skipping 28 matching lines...) Expand all
205 std::unique_ptr<PresentationFrameManager> frame_manager_; 214 std::unique_ptr<PresentationFrameManager> frame_manager_;
206 215
207 base::WeakPtrFactory<PresentationServiceDelegateImpl> weak_factory_; 216 base::WeakPtrFactory<PresentationServiceDelegateImpl> weak_factory_;
208 217
209 DISALLOW_COPY_AND_ASSIGN(PresentationServiceDelegateImpl); 218 DISALLOW_COPY_AND_ASSIGN(PresentationServiceDelegateImpl);
210 }; 219 };
211 220
212 } // namespace media_router 221 } // namespace media_router
213 222
214 #endif // CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_IMPL_H_ 223 #endif // CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698