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 7be4f3302903c383a71bda1e697580f9481cdaaa..7c2c69274568b2ea49514e7f4387188aa48ebcd9 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 |
| @@ -192,6 +192,15 @@ std::string GetLearnMoreUrl(const base::DictionaryValue* args) { |
| return help_url; |
| } |
| +bool SinksWithDomainInList(const std::vector<MediaSinkWithCastModes>& sinks) { |
| + for (const MediaSinkWithCastModes& sink_with_cast_modes : sinks) { |
| + const MediaSink& sink = sink_with_cast_modes.sink; |
| + if (!sink.domain().empty()) |
| + return true; |
| + } |
| + return false; |
| +} |
| + |
| } // namespace |
| MediaRouterWebUIMessageHandler::MediaRouterWebUIMessageHandler( |
| @@ -376,14 +385,20 @@ void MediaRouterWebUIMessageHandler::OnRequestInitialData( |
| // enabled. If the user enables sync after acknowledging the first run flow, |
| // this is treated as the user opting into Google services, including cloud |
| // services, if the browser is a Chrome branded build. |
| + SigninManagerBase* signin_manager = |
| + SigninManagerFactory::GetForProfile(profile); |
| if (!profile->GetPrefs()->GetBoolean( |
| prefs::kMediaRouterCloudServicesPrefSet) && |
| profile->IsSyncAllowed()) { |
| - SigninManagerBase* signin_manager = |
| - SigninManagerFactory::GetForProfile(profile); |
| show_cloud_pref = signin_manager && signin_manager->IsAuthenticated() && |
| ProfileSyncServiceFactory::GetForProfile(profile)->IsSyncActive(); |
| } |
| + initial_data.SetString("userEmail", |
|
apacible
2016/02/11 17:09:14
What would the behavior be like for scenarios wher
amp
2016/02/11 21:21:24
If the dialogue is still open and still shows sink
apacible
2016/02/12 21:26:15
Would the cloud mrp run discover when we do a sink
amp
2016/02/13 02:11:05
The CloudMRP will get the same queries, but it ign
apacible
2016/02/13 08:13:02
Acknowledged.
|
| + signin_manager->GetAuthenticatedAccountInfo().email); |
| + initial_data.SetString("userDomain", |
| + signin_manager->GetAuthenticatedAccountInfo().hosted_domain); |
| + initial_data.SetBoolean("showEmail", |
| + SinksWithDomainInList(media_router_ui_->sinks())); |
| #endif // defined(GOOGLE_CHROME_BUILD) |
| initial_data.SetBoolean("showFirstRunFlowCloudPref", show_cloud_pref); |