Chromium Code Reviews| 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 558392be1ab906683cf1dcc77d5e3ce185a2af91..80630a8dcfc301588f53c7809845d25d7b38a1c9 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 |
| @@ -349,11 +349,19 @@ void MediaRouterWebUIMessageHandler::OnRequestInitialData( |
| media_router_ui_->GetPresentationRequestSourceName())); |
| initial_data.Set("castModes", cast_modes_list.release()); |
| + Profile* profile = Profile::FromWebUI(web_ui()); |
| + |
| bool first_run_flow_acknowledged = |
| - Profile::FromWebUI(web_ui())->GetPrefs()->GetBoolean( |
| + profile->GetPrefs()->GetBoolean( |
| prefs::kMediaRouterFirstRunFlowAcknowledged); |
| initial_data.SetBoolean("wasFirstRunFlowAcknowledged", |
| first_run_flow_acknowledged); |
| +#if defined(GOOGLE_CHROME_BUILD) |
| + bool show_cloud_pref = profile->IsSyncAllowed() && |
|
imcheng
2016/01/25 19:21:06
can this be replaced with whether the kMediaRouter
imcheng
2016/01/25 19:21:06
Why is IsSyncAllowed() checked here? Could you add
apacible
2016/01/26 01:12:56
Added comments.
Per discussion with product, we o
apacible
2016/01/26 01:12:56
I'm not sure I understand this comment. kMediaRout
|
| + !profile->GetPrefs()->GetBoolean( |
| + prefs::kMediaRouterCloudServicesPrefSet); |
| + initial_data.SetBoolean("showFirstRunFlowCloudPref", show_cloud_pref); |
| +#endif // defined(GOOGLE_CHROME_BUILD) |
| web_ui()->CallJavascriptFunction(kSetInitialData, initial_data); |
| media_router_ui_->UIInitialized(); |
| @@ -415,6 +423,19 @@ void MediaRouterWebUIMessageHandler::OnAcknowledgeFirstRunFlow( |
| DVLOG(1) << "OnAcknowledgeFirstRunFlow"; |
| Profile::FromWebUI(web_ui())->GetPrefs()->SetBoolean( |
| prefs::kMediaRouterFirstRunFlowAcknowledged, true); |
| + |
| +#if defined(GOOGLE_CHROME_BUILD) |
| + bool enabled_cloud_services = false; |
| + if (!args->GetBoolean(0, &enabled_cloud_services)) { |
| + DVLOG(1) << "Unable to extract args."; |
| + return; |
| + } |
| + |
| + Profile::FromWebUI(web_ui())->GetPrefs()->SetBoolean( |
| + prefs::kMediaRouterEnableCloudServices, enabled_cloud_services); |
| + Profile::FromWebUI(web_ui())->GetPrefs()->SetBoolean( |
| + prefs::kMediaRouterCloudServicesPrefSet, true); |
| +#endif // defined(GOOGLE_CHROME_BUILD) |
| } |
| void MediaRouterWebUIMessageHandler::OnActOnIssue( |