| 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 15 matching lines...) Expand all Loading... |
| 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 Loading... |
| 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|, a |
| 194 // connection with the extension-side controller could not be established, |
| 195 // or on Android. |
| 196 virtual MediaRouteController* GetControllerForRoute( |
| 197 const MediaRoute::Id& route_id) = 0; |
| 198 |
| 192 private: | 199 private: |
| 193 friend class IssuesObserver; | 200 friend class IssuesObserver; |
| 194 friend class MediaSinksObserver; | 201 friend class MediaSinksObserver; |
| 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 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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; |
| 250 }; | 257 }; |
| 251 | 258 |
| 252 } // namespace media_router | 259 } // namespace media_router |
| 253 | 260 |
| 254 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ | 261 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ |
| OLD | NEW |