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 14 matching lines...) Expand all Loading... | |
| 25 | 25 |
| 26 namespace media_router { | 26 namespace media_router { |
| 27 | 27 |
| 28 class IssuesObserver; | 28 class IssuesObserver; |
| 29 class LocalMediaRoutesObserver; | 29 class LocalMediaRoutesObserver; |
| 30 class MediaRoutesObserver; | 30 class MediaRoutesObserver; |
| 31 class MediaSinksObserver; | 31 class MediaSinksObserver; |
| 32 class PresentationConnectionStateObserver; | 32 class PresentationConnectionStateObserver; |
| 33 class PresentationSessionMessagesObserver; | 33 class PresentationSessionMessagesObserver; |
| 34 | 34 |
| 35 // Type of callback used in |CreateRoute()| and |JoinRoute()|. Callback is | 35 // Type of callback used in |CreateRoute()| and |JoinRoute()| and |
|
mark a. foltz
2015/12/16 07:17:34
Nit: use comma instead of multiple "and"s.
matt.boetger
2015/12/18 23:37:14
Done.
| |
| 36 // |ConnectRouteByRouteId|. Callback is | |
|
imcheng
2015/12/17 02:30:57
Also ConnectRouteByRouteId() for consistency.
matt.boetger
2015/12/18 23:37:14
Done.
| |
| 36 // invoked when the route request either succeeded or failed. | 37 // invoked when the route request either succeeded or failed. |
| 37 // On success: | 38 // On success: |
| 38 // |route|: The route created or joined. | 39 // |route|: The route created or joined. |
| 39 // |presentation_id|: | 40 // |presentation_id|: |
| 40 // The presentation ID of the route created or joined. In the case of | 41 // The presentation ID of the route created or joined. In the case of |
| 41 // |CreateRoute()|, the ID is generated by MediaRouter and is guaranteed to | 42 // |CreateRoute()|, the ID is generated by MediaRouter and is guaranteed to |
| 42 // be unique. | 43 // be unique. |
| 43 // |error|: Empty string. | 44 // |error|: Empty string. |
| 44 // On failure: | 45 // On failure: |
| 45 // |route|: nullptr | 46 // |route|: nullptr |
| (...skipping 32 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. | 79 // 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 | 80 // Each callback in |callbacks| is invoked with a response indicating |
| 80 // success or failure, in the order they are listed. | 81 // success or failure, in the order they are listed. |
| 81 virtual void CreateRoute( | 82 virtual void CreateRoute( |
| 82 const MediaSource::Id& source_id, | 83 const MediaSource::Id& source_id, |
| 83 const MediaSink::Id& sink_id, | 84 const MediaSink::Id& sink_id, |
| 84 const GURL& origin, | 85 const GURL& origin, |
| 85 content::WebContents* web_contents, | 86 content::WebContents* web_contents, |
| 86 const std::vector<MediaRouteResponseCallback>& callbacks) = 0; | 87 const std::vector<MediaRouteResponseCallback>& callbacks) = 0; |
| 87 | 88 |
| 89 // Joins an existing route identified by |route_id|. This is used for | |
| 90 // non-local routes since no Presentation ID is available. | |
| 91 // |source|: The source to route to the existing route. | |
| 92 // |route_id|: Route ID of the existing route. | |
| 93 // |origin|, |web_contents|: Origin and WebContents of the join route request. | |
| 94 // Used for validation when enforcing same-origin and/or same-tab scope. | |
| 95 // (See CreateRoute documentation). | |
| 96 // Each callback in |callbacks| is invoked with a response indicating | |
| 97 // success or failure, in the order they are listed. | |
| 98 virtual void ConnectRouteByRouteId( | |
|
mark a. foltz
2015/12/16 07:17:34
It would be better to keep the nomenclature consis
matt.boetger
2015/12/18 23:37:14
Done.
| |
| 99 const MediaSource::Id& source_id, | |
| 100 const MediaRoute::Id& route_id, | |
| 101 const GURL& origin, | |
| 102 content::WebContents* web_contents, | |
| 103 const std::vector<MediaRouteResponseCallback>& callbacks) = 0; | |
| 104 | |
| 88 // Joins an existing route identified by |presentation_id|. | 105 // Joins an existing route identified by |presentation_id|. |
| 89 // |source|: The source to route to the existing route. | 106 // |source|: The source to route to the existing route. |
| 90 // |presentation_id|: Presentation ID of the existing route. | 107 // |presentation_id|: Presentation ID of the existing route. |
| 91 // |origin|, |web_contents|: Origin and WebContents of the join route request. | 108 // |origin|, |web_contents|: Origin and WebContents of the join route request. |
| 92 // Used for validation when enforcing same-origin and/or same-tab scope. | 109 // Used for validation when enforcing same-origin and/or same-tab scope. |
| 93 // (See CreateRoute documentation). | 110 // (See CreateRoute documentation). |
| 94 // Each callback in |callbacks| is invoked with a response indicating | 111 // Each callback in |callbacks| is invoked with a response indicating |
| 95 // success or failure, in the order they are listed. | 112 // success or failure, in the order they are listed. |
| 96 virtual void JoinRoute( | 113 virtual void JoinRoute( |
| 97 const MediaSource::Id& source, | 114 const MediaSource::Id& source, |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 LocalMediaRoutesObserver* observer) = 0; | 224 LocalMediaRoutesObserver* observer) = 0; |
| 208 | 225 |
| 209 // Removes the LocalMediaRoutesObserver |observer|. | 226 // Removes the LocalMediaRoutesObserver |observer|. |
| 210 virtual void UnregisterLocalMediaRoutesObserver( | 227 virtual void UnregisterLocalMediaRoutesObserver( |
| 211 LocalMediaRoutesObserver* observer) = 0; | 228 LocalMediaRoutesObserver* observer) = 0; |
| 212 }; | 229 }; |
| 213 | 230 |
| 214 } // namespace media_router | 231 } // namespace media_router |
| 215 | 232 |
| 216 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ | 233 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ |
| OLD | NEW |