Chromium Code Reviews| Index: chrome/browser/ui/webui/signin/inline_login_handler_impl.cc |
| diff --git a/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc b/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc |
| index 7d53c8db25f5695a05bffeba3d5433d6d9889551..c1d7d1da527131c129905c55ebf7af0f4250abb4 100644 |
| --- a/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc |
| +++ b/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc |
| @@ -69,6 +69,10 @@ void LogHistogramValue(int action) { |
| signin_metrics::HISTOGRAM_MAX); |
| } |
| +bool IsUserManagerReauthenticatingProfile(Profile* profile) { |
|
achuithb
2015/09/28 20:11:48
Could you please add a function comment?
Does it
Roger Tawa OOO till Jul 10th
2015/09/28 20:57:11
Done.
|
| + return profile->GetOriginalProfile()->IsSystemProfile(); |
| +} |
| + |
| void RedirectToNtpOrAppsPage(content::WebContents* contents, |
| signin_metrics::Source source) { |
| // Do nothing if a navigation is pending, since this call can be triggered |
| @@ -599,6 +603,12 @@ bool InlineLoginHandlerImpl::CanOffer(Profile* profile, |
| void InlineLoginHandlerImpl::SetExtraInitParams(base::DictionaryValue& params) { |
| params.SetString("service", "chromiumsync"); |
| + // If this was called from the user manager to reauthenticate the profile, |
| + // make sure the webui is aware. |
| + Profile* profile = Profile::FromWebUI(web_ui()); |
| + if (IsUserManagerReauthenticatingProfile(profile)) |
| + params.SetBoolean("dontResizeNonEmbeddedPages", true); |
| + |
| content::WebContents* contents = web_ui()->GetWebContents(); |
| content::WebContentsObserver::Observe(contents); |
| LogHistogramValue(signin_metrics::HISTOGRAM_SHOWN); |
| @@ -655,7 +665,7 @@ void InlineLoginHandlerImpl::CompleteLogin(const base::ListValue* args) { |
| // find the right profile to reauthenticate. Otherwise the profile can be |
| // taken from web_ui(). |
| Profile* profile = Profile::FromWebUI(web_ui()); |
| - if (profile->GetOriginalProfile()->IsSystemProfile()) { |
| + if (IsUserManagerReauthenticatingProfile(profile)) { |
| // Switch to the profile and finish the login. Don't pass a handler pointer |
| // since it will be destroyed before the callback runs. |
| ProfileManager* manager = g_browser_process->profile_manager(); |