Index: chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc |
diff --git a/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc b/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc |
index 6fe551cc3eb3bdf03ab5155bee361996b704caef..e9bfe75834b71f016b7610294556181ca351dbe4 100644 |
--- a/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc |
+++ b/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc |
@@ -419,6 +419,14 @@ void MediaRouterWebUIMessageHandler::OnRequestInitialData( |
cast_modes, media_router_ui_->GetPresentationRequestSourceName())); |
initial_data.Set("castModes", cast_modes_list.release()); |
+ MediaCastMode initial_cast_mode = |
imcheng
2016/11/14 19:56:59
What if |initial_cast_mode| is not in |cast_modes|
takumif
2016/11/16 01:34:27
Checking to make sure TAB_MIRROR is in |cast_modes
|
+ media_router_ui_->GetCastModeSelectionForCurrentHost(); |
+ if (initial_cast_mode != MediaCastMode::DEFAULT) { |
takumif
2016/11/08 22:52:16
Right now, GetCastModeSelectionForCurrentHost() re
apacible
2016/11/11 22:40:23
This looks fine.
takumif
2016/11/12 00:08:31
Okay!
imcheng
2016/11/14 19:56:59
Saw this comment after I posted my own comments. N
takumif
2016/11/16 01:34:27
Changing the pref to only keep track of hostnames
|
+ initial_data.Set( |
+ "initialCastMode", |
+ new base::FundamentalValue(static_cast<int>(initial_cast_mode))); |
+ } |
+ |
web_ui()->CallJavascriptFunctionUnsafe(kSetInitialData, initial_data); |
media_router_ui_->UIInitialized(); |
} |
@@ -698,6 +706,8 @@ void MediaRouterWebUIMessageHandler::OnReportSelectedCastMode( |
} |
UMA_HISTOGRAM_SPARSE_SLOWLY("MediaRouter.Ui.Navigate.SourceSelection", |
cast_mode_type); |
+ media_router_ui_->RecordCastModeSelection( |
+ static_cast<MediaCastMode>(cast_mode_type)); |
} |
void MediaRouterWebUIMessageHandler::OnReportSinkCount( |