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

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

Issue 2728543009: [Media Router] Custom Controls 2 - add MediaRouter::GetRouteController() (Closed)
Patch Set: Address Daniel's and Derek's comments Created 3 years, 8 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_MEDIA_ROUTER_H_ 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_
6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 15 matching lines...) Expand all
26 class WebContents; 26 class WebContents;
27 } 27 }
28 28
29 namespace url { 29 namespace url {
30 class Origin; 30 class Origin;
31 } // namespace url 31 } // namespace url
32 32
33 namespace media_router { 33 namespace media_router {
34 34
35 class IssuesObserver; 35 class IssuesObserver;
36 class MediaRouteController;
36 class MediaRoutesObserver; 37 class MediaRoutesObserver;
37 class MediaSinksObserver; 38 class MediaSinksObserver;
38 class PresentationConnectionStateObserver; 39 class PresentationConnectionStateObserver;
39 class RouteRequestResult; 40 class RouteRequestResult;
40 41
41 // Type of callback used in |CreateRoute()|, |JoinRoute()|, and 42 // Type of callback used in |CreateRoute()|, |JoinRoute()|, and
42 // |ConnectRouteByRouteId()|. Callback is invoked when the route request either 43 // |ConnectRouteByRouteId()|. Callback is invoked when the route request either
43 // succeeded or failed. 44 // succeeded or failed.
44 using MediaRouteResponseCallback = 45 using MediaRouteResponseCallback =
45 base::Callback<void(const RouteRequestResult& result)>; 46 base::Callback<void(const RouteRequestResult& result)>;
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 const content::PresentationConnectionStateChangedCallback& callback) = 0; 183 const content::PresentationConnectionStateChangedCallback& callback) = 0;
183 184
184 // Called when the incognito profile for this instance is being shut down. 185 // Called when the incognito profile for this instance is being shut down.
185 // This will terminate all incognito media routes. 186 // This will terminate all incognito media routes.
186 virtual void OnIncognitoProfileShutdown() = 0; 187 virtual void OnIncognitoProfileShutdown() = 0;
187 188
188 // Returns the media routes that currently exist. To get notified whenever 189 // Returns the media routes that currently exist. To get notified whenever
189 // there is a change to the media routes, subclass MediaRoutesObserver. 190 // there is a change to the media routes, subclass MediaRoutesObserver.
190 virtual std::vector<MediaRoute> GetCurrentRoutes() const = 0; 191 virtual std::vector<MediaRoute> GetCurrentRoutes() const = 0;
191 192
193 // Returns a nullptr if no MediaRoute exists for the given |route_id|, if a
194 // connection with the extension-side controller could not be established.
mark a. foltz 2017/03/30 23:03:28 How does this behave on Android? Suggest dropping
takumif 2017/04/04 03:19:50 It'd return a nullptr for now. Dropped the last pa
195 virtual scoped_refptr<MediaRouteController> GetRouteController(
196 const MediaRoute::Id& route_id) = 0;
197
192 private: 198 private:
193 friend class IssuesObserver; 199 friend class IssuesObserver;
194 friend class MediaSinksObserver; 200 friend class MediaSinksObserver;
201 friend class MediaRouteController;
195 friend class MediaRoutesObserver; 202 friend class MediaRoutesObserver;
196 friend class PresentationConnectionStateObserver; 203 friend class PresentationConnectionStateObserver;
197 friend class RouteMessageObserver; 204 friend class RouteMessageObserver;
198 205
199 // The following functions are called by friend Observer classes above. 206 // The following functions are called by friend Observer classes above.
200 207
201 // Registers |observer| with this MediaRouter. |observer| specifies a media 208 // Registers |observer| with this MediaRouter. |observer| specifies a media
202 // source and will receive updates with media sinks that are compatible with 209 // source and will receive updates with media sinks that are compatible with
203 // that source. The initial update may happen synchronously. 210 // that source. The initial update may happen synchronously.
204 // NOTE: This class does not assume ownership of |observer|. Callers must 211 // NOTE: This class does not assume ownership of |observer|. Callers must
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 // route and will receive messages from the MediaSink connected to the 247 // route and will receive messages from the MediaSink connected to the
241 // route. Note that MediaRouter does not own |observer|. |observer| should be 248 // route. Note that MediaRouter does not own |observer|. |observer| should be
242 // unregistered before it is destroyed. Registering the same observer more 249 // unregistered before it is destroyed. Registering the same observer more
243 // than once will result in undefined behavior. 250 // than once will result in undefined behavior.
244 virtual void RegisterRouteMessageObserver(RouteMessageObserver* observer) = 0; 251 virtual void RegisterRouteMessageObserver(RouteMessageObserver* observer) = 0;
245 252
246 // Unregisters a previously registered RouteMessagesObserver. |observer| will 253 // Unregisters a previously registered RouteMessagesObserver. |observer| will
247 // stop receiving further updates. 254 // stop receiving further updates.
248 virtual void UnregisterRouteMessageObserver( 255 virtual void UnregisterRouteMessageObserver(
249 RouteMessageObserver* observer) = 0; 256 RouteMessageObserver* observer) = 0;
257
258 // Removes the MediaRouteController for |route_id| from the list of
259 // controllers held by |this|.
260 virtual void DetachRouteController(const MediaRoute::Id& route_id,
261 MediaRouteController* controller) = 0;
250 }; 262 };
251 263
252 } // namespace media_router 264 } // namespace media_router
253 265
254 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ 266 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698