Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1553)

Unified Diff: chrome/browser/ui/webui/media_router/media_router_webui_message_handler.h

Issue 2068593002: [Media Router] Assign each route a current cast mode if possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/media_router/media_router_webui_message_handler.h
diff --git a/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.h b/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.h
index 62c193a7e573a96bfd468b33b853772436979afa..37822d731570c48e63b94d8a6e0e5cd4bc596002 100644
--- a/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.h
+++ b/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.h
@@ -39,7 +39,9 @@ class MediaRouterWebUIMessageHandler : public content::WebUIMessageHandler {
// Methods to update the status displayed by the dialog.
void UpdateSinks(const std::vector<MediaSinkWithCastModes>& sinks);
void UpdateRoutes(const std::vector<MediaRoute>& routes,
- const std::vector<MediaRoute::Id>& joinable_route_ids);
+ const std::vector<MediaRoute::Id>& joinable_route_ids,
+ const std::unordered_map<MediaRoute::Id, MediaCastMode>&
+ current_cast_modes);
void UpdateCastModes(const CastModeSet& cast_modes,
const std::string& source_host);
void OnCreateRouteResponseReceived(const MediaSink::Id& sink_id,
@@ -98,11 +100,20 @@ class MediaRouterWebUIMessageHandler : public content::WebUIMessageHandler {
// initializing the WebUI.
void MaybeUpdateFirstRunFlowData();
+ // Returns the current cast mode for the route with ID |route_id| or -1 if the
+ // route has no current cast mode.
+ int CurrentCastModeForRouteId(
+ const MediaRoute::Id& route_id,
+ const std::unordered_map<MediaRoute::Id, MediaCastMode>&
+ current_cast_modes) const;
+
// Converts |routes| and |joinable_route_ids| into base::ListValue that can be
// passed to WebUI.
std::unique_ptr<base::ListValue> RoutesToValue(
const std::vector<MediaRoute>& routes,
- const std::vector<MediaRoute::Id>& joinable_route_ids) const;
+ const std::vector<MediaRoute::Id>& joinable_route_ids,
+ const std::unordered_map<MediaRoute::Id, MediaCastMode>&
+ current_cast_modes) const;
// Retrieve the account info for email and domain of signed in users. This is
// used when updating sinks to determine if identity should be displayed.

Powered by Google App Engine
This is Rietveld 408576698