| 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_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 // Calls MediaRouter to close the given route. | 110 // Calls MediaRouter to close the given route. |
| 111 void CloseRoute(const MediaRoute::Id& route_id); | 111 void CloseRoute(const MediaRoute::Id& route_id); |
| 112 | 112 |
| 113 // Calls MediaRouter to add the given issue. | 113 // Calls MediaRouter to add the given issue. |
| 114 void AddIssue(const Issue& issue); | 114 void AddIssue(const Issue& issue); |
| 115 | 115 |
| 116 // Calls MediaRouter to clear the given issue. | 116 // Calls MediaRouter to clear the given issue. |
| 117 void ClearIssue(const Issue::Id& issue_id); | 117 void ClearIssue(const Issue::Id& issue_id); |
| 118 | 118 |
| 119 // Calls MediaRouter to search route providers for |sink_id| with the source |
| 120 // that is currently associated with |cast_mode|. |
| 121 void SearchProviders(const MediaSink::Id& sink_id, MediaCastMode cast_mode); |
| 122 |
| 119 // Returns the hostname of the default source's parent frame URL. | 123 // Returns the hostname of the default source's parent frame URL. |
| 120 std::string GetPresentationRequestSourceName() const; | 124 std::string GetPresentationRequestSourceName() const; |
| 121 std::string GetTruncatedPresentationRequestSourceName() const; | 125 std::string GetTruncatedPresentationRequestSourceName() const; |
| 122 bool HasPendingRouteRequest() const { | 126 bool HasPendingRouteRequest() const { |
| 123 return current_route_request_id_ != -1; | 127 return current_route_request_id_ != -1; |
| 124 } | 128 } |
| 125 const std::vector<MediaSinkWithCastModes>& sinks() const { return sinks_; } | 129 const std::vector<MediaSinkWithCastModes>& sinks() const { return sinks_; } |
| 126 const std::vector<MediaRoute>& routes() const { return routes_; } | 130 const std::vector<MediaRoute>& routes() const { return routes_; } |
| 127 const std::vector<MediaRoute::Id>& joinable_route_ids() const { | 131 const std::vector<MediaRoute::Id>& joinable_route_ids() const { |
| 128 return joinable_route_ids_; | 132 return joinable_route_ids_; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 | 185 |
| 182 DISALLOW_COPY_AND_ASSIGN(UIMediaRoutesObserver); | 186 DISALLOW_COPY_AND_ASSIGN(UIMediaRoutesObserver); |
| 183 }; | 187 }; |
| 184 | 188 |
| 185 static std::string GetExtensionName(const GURL& url, | 189 static std::string GetExtensionName(const GURL& url, |
| 186 extensions::ExtensionRegistry* registry); | 190 extensions::ExtensionRegistry* registry); |
| 187 | 191 |
| 188 // QueryResultManager::Observer | 192 // QueryResultManager::Observer |
| 189 void OnResultsUpdated( | 193 void OnResultsUpdated( |
| 190 const std::vector<MediaSinkWithCastModes>& sinks) override; | 194 const std::vector<MediaSinkWithCastModes>& sinks) override; |
| 195 void OnSearchResultsReceived( |
| 196 const MediaSink::Id& sink_id, |
| 197 const std::vector<MediaSinkWithCastModes>& sinks) override; |
| 198 |
| 199 void SortAndUpdateSinks(); |
| 191 | 200 |
| 192 // Called by |issues_observer_| when the top issue has changed. | 201 // Called by |issues_observer_| when the top issue has changed. |
| 193 // If the UI is already initialized, notifies |handler_| to update the UI. | 202 // If the UI is already initialized, notifies |handler_| to update the UI. |
| 194 // Ignored if the UI is not yet initialized. | 203 // Ignored if the UI is not yet initialized. |
| 195 void SetIssue(const Issue* issue); | 204 void SetIssue(const Issue* issue); |
| 196 | 205 |
| 197 // Called by |routes_observer_| when the set of active routes has changed. | 206 // Called by |routes_observer_| when the set of active routes has changed. |
| 198 void OnRoutesUpdated(const std::vector<MediaRoute>& routes, | 207 void OnRoutesUpdated(const std::vector<MediaRoute>& routes, |
| 199 const std::vector<MediaRoute::Id>& joinable_route_ids); | 208 const std::vector<MediaRoute::Id>& joinable_route_ids); |
| 200 | 209 |
| 201 // Callback passed to MediaRouter to receive response to route creation | 210 // Callback passed to MediaRouter to receive response to route creation |
| 202 // requests. | 211 // requests. |
| 203 void OnRouteResponseReceived( | 212 void OnRouteResponseReceived( |
| 204 int route_request_id, | 213 int route_request_id, |
| 205 const MediaSink::Id& sink_id, | 214 const MediaSink::Id& sink_id, |
| 206 MediaCastMode cast_mode, | 215 MediaCastMode cast_mode, |
| 207 const base::string16& presentation_request_source_name, | 216 const base::string16& presentation_request_source_name, |
| 208 const RouteRequestResult& result); | 217 const RouteRequestResult& result); |
| 209 | 218 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 // NOTE: Weak pointers must be invalidated before all other member variables. | 305 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 297 // Therefore |weak_factory_| must be placed at the end. | 306 // Therefore |weak_factory_| must be placed at the end. |
| 298 base::WeakPtrFactory<MediaRouterUI> weak_factory_; | 307 base::WeakPtrFactory<MediaRouterUI> weak_factory_; |
| 299 | 308 |
| 300 DISALLOW_COPY_AND_ASSIGN(MediaRouterUI); | 309 DISALLOW_COPY_AND_ASSIGN(MediaRouterUI); |
| 301 }; | 310 }; |
| 302 | 311 |
| 303 } // namespace media_router | 312 } // namespace media_router |
| 304 | 313 |
| 305 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_H_ | 314 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_H_ |
| OLD | NEW |