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 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 78 // The caller may pass in nullptr for |web_contents| if tab is not applicable. | 78 // The caller may pass in nullptr for |web_contents| if tab is not applicable. |
| 79 // Each callback in |callbacks| is invoked with a response indicating | 79 // Each callback in |callbacks| is invoked with a response indicating |
| 80 // success or failure, in the order they are listed. | 80 // success or failure, in the order they are listed. |
| 81 virtual void CreateRoute( | 81 virtual void CreateRoute( |
| 82 const MediaSource::Id& source_id, | 82 const MediaSource::Id& source_id, |
| 83 const MediaSink::Id& sink_id, | 83 const MediaSink::Id& sink_id, |
| 84 const GURL& origin, | 84 const GURL& origin, |
| 85 content::WebContents* web_contents, | 85 content::WebContents* web_contents, |
| 86 const std::vector<MediaRouteResponseCallback>& callbacks) = 0; | 86 const std::vector<MediaRouteResponseCallback>& callbacks) = 0; |
| 87 | 87 |
| 88 // Joins an existing route identified by |route_id|. This is used for | |
| 89 // non-local routes since no Presentation ID is available. | |
| 90 // |source|: The source to route to the existing route. | |
| 91 // |route_id|: Route ID of the existing route. | |
| 92 // |origin|, |web_contents|: Origin and WebContents of the join route request. | |
| 93 // Used for validation when enforcing same-origin and/or same-tab scope. | |
| 94 // (See CreateRoute documentation). | |
| 95 // Each callback in |callbacks| is invoked with a response indicating | |
| 96 // success or failure, in the order they are listed. | |
| 97 virtual void JoinRouteByRouteId( | |
| 98 const MediaSource::Id& source, | |
|
mark a. foltz
2015/12/03 19:24:23
source_id for consistency with CreateRoute
matt.boetger
2015/12/15 19:21:20
Done.
| |
| 99 const MediaRoute::Id& route_id, | |
|
mark a. foltz
2015/12/03 19:24:23
Note, the route_id should include the source_id (o
mark a. foltz
2015/12/09 00:48:16
You can ignore this comment.
matt.boetger
2015/12/15 19:21:20
Done.
matt.boetger
2015/12/15 19:21:20
Done.
| |
| 100 const GURL& origin, | |
| 101 content::WebContents* web_contents, | |
| 102 const std::vector<MediaRouteResponseCallback>& callbacks) = 0; | |
| 103 | |
| 88 // Joins an existing route identified by |presentation_id|. | 104 // Joins an existing route identified by |presentation_id|. |
| 89 // |source|: The source to route to the existing route. | 105 // |source|: The source to route to the existing route. |
| 90 // |presentation_id|: Presentation ID of the existing route. | 106 // |presentation_id|: Presentation ID of the existing route. |
| 91 // |origin|, |web_contents|: Origin and WebContents of the join route request. | 107 // |origin|, |web_contents|: Origin and WebContents of the join route request. |
| 92 // Used for validation when enforcing same-origin and/or same-tab scope. | 108 // Used for validation when enforcing same-origin and/or same-tab scope. |
| 93 // (See CreateRoute documentation). | 109 // (See CreateRoute documentation). |
| 94 // Each callback in |callbacks| is invoked with a response indicating | 110 // Each callback in |callbacks| is invoked with a response indicating |
| 95 // success or failure, in the order they are listed. | 111 // success or failure, in the order they are listed. |
| 96 virtual void JoinRoute( | 112 virtual void JoinRoute( |
| 97 const MediaSource::Id& source, | 113 const MediaSource::Id& source, |
| 98 const std::string& presentation_id, | 114 const std::string& presentation_id, |
|
mark a. foltz
2015/12/03 19:24:23
I still think this API is weird, but I think I und
matt.boetger
2015/12/15 19:21:20
If we're going to a new method, 'connectRouteByRou
| |
| 99 const GURL& origin, | 115 const GURL& origin, |
| 100 content::WebContents* web_contents, | 116 content::WebContents* web_contents, |
| 101 const std::vector<MediaRouteResponseCallback>& callbacks) = 0; | 117 const std::vector<MediaRouteResponseCallback>& callbacks) = 0; |
| 102 | 118 |
| 103 // Closes the media route specified by |route_id|. | 119 // Closes the media route specified by |route_id|. |
| 104 virtual void CloseRoute(const MediaRoute::Id& route_id) = 0; | 120 virtual void CloseRoute(const MediaRoute::Id& route_id) = 0; |
| 105 | 121 |
| 106 // Posts |message| to a MediaSink connected via MediaRoute with |route_id|. | 122 // Posts |message| to a MediaSink connected via MediaRoute with |route_id|. |
| 107 virtual void SendRouteMessage(const MediaRoute::Id& route_id, | 123 virtual void SendRouteMessage(const MediaRoute::Id& route_id, |
| 108 const std::string& message, | 124 const std::string& message, |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 LocalMediaRoutesObserver* observer) = 0; | 223 LocalMediaRoutesObserver* observer) = 0; |
| 208 | 224 |
| 209 // Removes the LocalMediaRoutesObserver |observer|. | 225 // Removes the LocalMediaRoutesObserver |observer|. |
| 210 virtual void UnregisterLocalMediaRoutesObserver( | 226 virtual void UnregisterLocalMediaRoutesObserver( |
| 211 LocalMediaRoutesObserver* observer) = 0; | 227 LocalMediaRoutesObserver* observer) = 0; |
| 212 }; | 228 }; |
| 213 | 229 |
| 214 } // namespace media_router | 230 } // namespace media_router |
| 215 | 231 |
| 216 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ | 232 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ |
| OLD | NEW |