Commit 2b7213d4 authored by Ramin Halavati's avatar Ramin Halavati Committed by Commit Bot

Update NewTabPage for ephemeral Guest profiles.

Guest NTP is now shown for ephemeral Guest profiles.

This change is behind disabled EnableEphemeralGuestProfilesOnDesktop
flag. Please see go/guest-on-disk for more context.

Bug: 1125474
Change-Id: I1b2e8f727f92c10d561e630ac7bce61b5d4eef94
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2452731
Commit-Queue: Ramin Halavati <rhalavati@chromium.org>
Reviewed-by: default avatarMoe Ahmadi <mahmadi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814564}
parent 0110c9c7
......@@ -172,9 +172,11 @@ struct NewTabURLDetails {
: url(url), state(state) {}
static NewTabURLDetails ForProfile(Profile* profile) {
// Incognito has its own New Tab.
if (profile->IsOffTheRecord())
// Incognito and Guest profiles have their own New Tab.
if (profile->IsIncognitoProfile() || profile->IsGuestSession() ||
profile->IsEphemeralGuestProfile()) {
return NewTabURLDetails(GURL(), NEW_TAB_URL_INCOGNITO);
}
#if defined(OS_ANDROID)
const GURL local_url(chrome::kChromeSearchLocalNtpUrl);
......
......@@ -58,7 +58,7 @@ NewTabUI::NewTabUI(content::WebUI* web_ui) : content::WebUIController(web_ui) {
Profile* profile = GetProfile();
if (!profile->IsGuestSession()) {
if (!profile->IsGuestSession() && !profile->IsEphemeralGuestProfile()) {
web_ui->AddMessageHandler(std::make_unique<ThemeHandler>());
if (profile->IsOffTheRecord()) {
web_ui->AddMessageHandler(
......
......@@ -200,7 +200,7 @@ bool NTPResourceCache::NewTabHTMLNeedsRefresh() {
NTPResourceCache::WindowType NTPResourceCache::GetWindowType(
Profile* profile, content::RenderProcessHost* render_host) {
if (profile->IsGuestSession()) {
if (profile->IsGuestSession() || profile->IsEphemeralGuestProfile()) {
return GUEST;
} else if (render_host) {
// Sometimes the |profile| is the parent (non-incognito) version of the user
......
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