| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 namespace media_router { | 28 namespace media_router { |
| 29 | 29 |
| 30 class IssuesObserver; | 30 class IssuesObserver; |
| 31 class LocalMediaRoutesObserver; | 31 class LocalMediaRoutesObserver; |
| 32 class MediaRoutesObserver; | 32 class MediaRoutesObserver; |
| 33 class MediaSinksObserver; | 33 class MediaSinksObserver; |
| 34 class PresentationConnectionStateObserver; | 34 class PresentationConnectionStateObserver; |
| 35 class PresentationSessionMessagesObserver; | 35 class PresentationSessionMessagesObserver; |
| 36 | 36 |
| 37 // Type of callback used in |CreateRoute()| and |JoinRoute()|. Callback is | 37 // Type of callback used in |CreateRoute()|, |JoinRoute()|, and |
| 38 // |ConnectRouteByRouteId()|. Callback is |
| 38 // invoked when the route request either succeeded or failed. | 39 // invoked when the route request either succeeded or failed. |
| 39 // On success: | 40 // On success: |
| 40 // |route|: The route created or joined. | 41 // |route|: The route created or joined. |
| 41 // |presentation_id|: | 42 // |presentation_id|: |
| 42 // The presentation ID of the route created or joined. In the case of | 43 // The presentation ID of the route created or joined. In the case of |
| 43 // |CreateRoute()|, the ID is generated by MediaRouter and is guaranteed to | 44 // |CreateRoute()|, the ID is generated by MediaRouter and is guaranteed to |
| 44 // be unique. | 45 // be unique. |
| 45 // |error|: Empty string. | 46 // |error|: Empty string. |
| 46 // On failure: | 47 // On failure: |
| 47 // |route|: nullptr | 48 // |route|: nullptr |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // The caller may pass in nullptr for |web_contents| if tab is not applicable. | 81 // The caller may pass in nullptr for |web_contents| if tab is not applicable. |
| 81 // Each callback in |callbacks| is invoked with a response indicating | 82 // Each callback in |callbacks| is invoked with a response indicating |
| 82 // success or failure, in the order they are listed. | 83 // success or failure, in the order they are listed. |
| 83 virtual void CreateRoute( | 84 virtual void CreateRoute( |
| 84 const MediaSource::Id& source_id, | 85 const MediaSource::Id& source_id, |
| 85 const MediaSink::Id& sink_id, | 86 const MediaSink::Id& sink_id, |
| 86 const GURL& origin, | 87 const GURL& origin, |
| 87 content::WebContents* web_contents, | 88 content::WebContents* web_contents, |
| 88 const std::vector<MediaRouteResponseCallback>& callbacks) = 0; | 89 const std::vector<MediaRouteResponseCallback>& callbacks) = 0; |
| 89 | 90 |
| 91 // Creates a route and connects it to an existing route identified by |
| 92 // |route_id|. |route_id| must refer to a non-local route, unnassociated with |
| 93 // a Presentation ID, because a new Presentation ID will be created. |
| 94 // |source|: The source to route to the existing route. |
| 95 // |route_id|: Route ID of the existing route. |
| 96 // |origin|, |web_contents|: Origin and WebContents of the join route request. |
| 97 // Used for validation when enforcing same-origin and/or same-tab scope. |
| 98 // (See CreateRoute documentation). |
| 99 // Each callback in |callbacks| is invoked with a response indicating |
| 100 // success or failure, in the order they are listed. |
| 101 virtual void ConnectRouteByRouteId( |
| 102 const MediaSource::Id& source_id, |
| 103 const MediaRoute::Id& route_id, |
| 104 const GURL& origin, |
| 105 content::WebContents* web_contents, |
| 106 const std::vector<MediaRouteResponseCallback>& callbacks) = 0; |
| 107 |
| 90 // Joins an existing route identified by |presentation_id|. | 108 // Joins an existing route identified by |presentation_id|. |
| 91 // |source|: The source to route to the existing route. | 109 // |source|: The source to route to the existing route. |
| 92 // |presentation_id|: Presentation ID of the existing route. | 110 // |presentation_id|: Presentation ID of the existing route. |
| 93 // |origin|, |web_contents|: Origin and WebContents of the join route request. | 111 // |origin|, |web_contents|: Origin and WebContents of the join route request. |
| 94 // Used for validation when enforcing same-origin and/or same-tab scope. | 112 // Used for validation when enforcing same-origin and/or same-tab scope. |
| 95 // (See CreateRoute documentation). | 113 // (See CreateRoute documentation). |
| 96 // Each callback in |callbacks| is invoked with a response indicating | 114 // Each callback in |callbacks| is invoked with a response indicating |
| 97 // success or failure, in the order they are listed. | 115 // success or failure, in the order they are listed. |
| 98 virtual void JoinRoute( | 116 virtual void JoinRoute( |
| 99 const MediaSource::Id& source, | 117 const MediaSource::Id& source, |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 LocalMediaRoutesObserver* observer) = 0; | 226 LocalMediaRoutesObserver* observer) = 0; |
| 209 | 227 |
| 210 // Removes the LocalMediaRoutesObserver |observer|. | 228 // Removes the LocalMediaRoutesObserver |observer|. |
| 211 virtual void UnregisterLocalMediaRoutesObserver( | 229 virtual void UnregisterLocalMediaRoutesObserver( |
| 212 LocalMediaRoutesObserver* observer) = 0; | 230 LocalMediaRoutesObserver* observer) = 0; |
| 213 }; | 231 }; |
| 214 | 232 |
| 215 } // namespace media_router | 233 } // namespace media_router |
| 216 | 234 |
| 217 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ | 235 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ |
| OLD | NEW |