| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // (See CreateRoute documentation). | 93 // (See CreateRoute documentation). |
| 94 // Each callback in |callbacks| is invoked with a response indicating | 94 // Each callback in |callbacks| is invoked with a response indicating |
| 95 // success or failure, in the order they are listed. | 95 // success or failure, in the order they are listed. |
| 96 virtual void JoinRoute( | 96 virtual void JoinRoute( |
| 97 const MediaSource::Id& source, | 97 const MediaSource::Id& source, |
| 98 const std::string& presentation_id, | 98 const std::string& presentation_id, |
| 99 const GURL& origin, | 99 const GURL& origin, |
| 100 content::WebContents* web_contents, | 100 content::WebContents* web_contents, |
| 101 const std::vector<MediaRouteResponseCallback>& callbacks) = 0; | 101 const std::vector<MediaRouteResponseCallback>& callbacks) = 0; |
| 102 | 102 |
| 103 // Closes the media route specified by |route_id|. | 103 // Terminates the media route specified by |route_id|. |
| 104 virtual void CloseRoute(const MediaRoute::Id& route_id) = 0; | 104 virtual void TerminateRoute(const MediaRoute::Id& route_id) = 0; |
| 105 |
| 106 // Detaches the media route specified by |route_id|. The request might come |
| 107 // from the page or from an event like navigation or garbage collection. |
| 108 virtual void DetachRoute(const MediaRoute::Id& route_id) = 0; |
| 105 | 109 |
| 106 // Posts |message| to a MediaSink connected via MediaRoute with |route_id|. | 110 // Posts |message| to a MediaSink connected via MediaRoute with |route_id|. |
| 107 virtual void SendRouteMessage(const MediaRoute::Id& route_id, | 111 virtual void SendRouteMessage(const MediaRoute::Id& route_id, |
| 108 const std::string& message, | 112 const std::string& message, |
| 109 const SendRouteMessageCallback& callback) = 0; | 113 const SendRouteMessageCallback& callback) = 0; |
| 110 | 114 |
| 111 // Sends |data| to a MediaSink connected via MediaRoute with |route_id|. | 115 // Sends |data| to a MediaSink connected via MediaRoute with |route_id|. |
| 112 // This is called for Blob / ArrayBuffer / ArrayBufferView types. | 116 // This is called for Blob / ArrayBuffer / ArrayBufferView types. |
| 113 virtual void SendRouteBinaryMessage( | 117 virtual void SendRouteBinaryMessage( |
| 114 const MediaRoute::Id& route_id, | 118 const MediaRoute::Id& route_id, |
| 115 scoped_ptr<std::vector<uint8>> data, | 119 scoped_ptr<std::vector<uint8>> data, |
| 116 const SendRouteMessageCallback& callback) = 0; | 120 const SendRouteMessageCallback& callback) = 0; |
| 117 | 121 |
| 118 // Adds a new |issue|. | 122 // Adds a new |issue|. |
| 119 virtual void AddIssue(const Issue& issue) = 0; | 123 virtual void AddIssue(const Issue& issue) = 0; |
| 120 | 124 |
| 121 // Clears the issue with the id |issue_id|. | 125 // Clears the issue with the id |issue_id|. |
| 122 virtual void ClearIssue(const Issue::Id& issue_id) = 0; | 126 virtual void ClearIssue(const Issue::Id& issue_id) = 0; |
| 123 | 127 |
| 124 // Indicates that a presentation session has detached from the underlying | |
| 125 // MediaRoute |route_id| (due to navigation, garbage collection, etc.) | |
| 126 virtual void OnPresentationSessionDetached( | |
| 127 const MediaRoute::Id& route_id) = 0; | |
| 128 | |
| 129 // Returns whether or not there is currently an active local displayable | 128 // Returns whether or not there is currently an active local displayable |
| 130 // route. | 129 // route. |
| 131 virtual bool HasLocalDisplayRoute() const = 0; | 130 virtual bool HasLocalDisplayRoute() const = 0; |
| 132 | 131 |
| 133 // Adds |callback| to listen for state changes for presentation connected to | 132 // Adds |callback| to listen for state changes for presentation connected to |
| 134 // |route_id|. The returned Subscription object is owned by the caller. | 133 // |route_id|. The returned Subscription object is owned by the caller. |
| 135 // |callback| will be invoked whenever there are state changes, until the | 134 // |callback| will be invoked whenever there are state changes, until the |
| 136 // caller destroys the Subscription object. | 135 // caller destroys the Subscription object. |
| 137 virtual scoped_ptr<PresentationConnectionStateSubscription> | 136 virtual scoped_ptr<PresentationConnectionStateSubscription> |
| 138 AddPresentationConnectionStateChangedCallback( | 137 AddPresentationConnectionStateChangedCallback( |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 LocalMediaRoutesObserver* observer) = 0; | 206 LocalMediaRoutesObserver* observer) = 0; |
| 208 | 207 |
| 209 // Removes the LocalMediaRoutesObserver |observer|. | 208 // Removes the LocalMediaRoutesObserver |observer|. |
| 210 virtual void UnregisterLocalMediaRoutesObserver( | 209 virtual void UnregisterLocalMediaRoutesObserver( |
| 211 LocalMediaRoutesObserver* observer) = 0; | 210 LocalMediaRoutesObserver* observer) = 0; |
| 212 }; | 211 }; |
| 213 | 212 |
| 214 } // namespace media_router | 213 } // namespace media_router |
| 215 | 214 |
| 216 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ | 215 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ |
| OLD | NEW |