Commit a80bb6a6 authored by msarda's avatar msarda Committed by Commit bot

Avoid loading the chrome sign-in URLs in incognito

Chrome sign-in URLS are only supposed to be open in regular profiles and
loading them in incognito or guest profiles leads to crashes.

This CL avoids loading these URLs on incognito profiles.

Screenshots after this change in a guest session:
https://drive.google.com/a/chromium.org/file/d/0Bw1MJ8m7U5kbeHUxR0lZbGs4OFU/view?usp=sharing
https://drive.google.com/a/chromium.org/file/d/0Bw1MJ8m7U5kbV2I4TnJ4enpuazg/view?usp=sharing
https://drive.google.com/a/chromium.org/file/d/0Bw1MJ8m7U5kbLWdVOUZkc0JfeEU/view?usp=sharing

BUG=679265

Review-Url: https://codereview.chromium.org/2621083002
Cr-Commit-Position: refs/heads/master@{#443014}
parent 87f7645f
......@@ -538,15 +538,19 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
return &NewWebUI<InspectUI>;
#endif
#if !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
if (url.host_piece() == chrome::kChromeUIChromeSigninHost)
if (url.host_piece() == chrome::kChromeUIChromeSigninHost &&
!profile->IsOffTheRecord())
return &NewWebUI<InlineLoginUI>;
if (url.host_piece() == chrome::kChromeUIMdUserManagerHost)
return &NewWebUI<MDUserManagerUI>;
if (url.host_piece() == chrome::kChromeUISigninErrorHost)
if (url.host_piece() == chrome::kChromeUISigninErrorHost &&
!profile->IsOffTheRecord())
return &NewWebUI<SigninErrorUI>;
if (url.host_piece() == chrome::kChromeUISyncConfirmationHost)
if (url.host_piece() == chrome::kChromeUISyncConfirmationHost &&
!profile->IsOffTheRecord())
return &NewWebUI<SyncConfirmationUI>;
if (url.host_piece() == chrome::kChromeUISigninEmailConfirmationHost)
if (url.host_piece() == chrome::kChromeUISigninEmailConfirmationHost &&
!profile->IsOffTheRecord())
return &NewWebUI<SigninEmailConfirmationUI>;
if (url.host_piece() == chrome::kChromeUIWelcomeHost)
return &NewWebUI<WelcomeUI>;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment